You're calling GetMeta() twice here. Use a switch (GetMeta()) instead. Also, name those constants (0x01, 0x02) as E_META_NETHER_PORTAL_SAME_X and E_META_NETHER_PORTAL_SAME_Z