TROR no-SE7 water: allow boundary change only if other-side lotag is other one.

That is, if submerging, the lower sector MUST have lotag 2. If emerging, the
upper sector MUST have lotag 1. (Previously, emersion happened from ST 2 sectors
unconditionally.)  This means that the area where submersion or emersion can
happen is now the same for the top and bottom parts.

git-svn-id: https://svn.eduke32.com/eduke32@3677 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-04-15 10:48:00 +00:00
parent 3cd85edac0
commit 84e8ce6855

View file

@ -1079,8 +1079,14 @@ ACTOR_STATIC void G_MovePlayers(void)
int32_t othersect = yax_getneighborsect( int32_t othersect = yax_getneighborsect(
s->x, s->y, psect, slotag==ST_1_ABOVE_WATER ? YAX_FLOOR : YAX_CEILING); s->x, s->y, psect, slotag==ST_1_ABOVE_WATER ? YAX_FLOOR : YAX_CEILING);
int32_t othertag = (slotag==ST_1_ABOVE_WATER) ?
ST_2_UNDERWATER : ST_1_ABOVE_WATER;
// If submerging, the lower sector MUST have lotag 2. // If submerging, the lower sector MUST have lotag 2.
if (othersect >= 0 && (slotag==ST_2_UNDERWATER || sector[othersect].lotag==ST_2_UNDERWATER)) // If emerging, the upper sector MUST have lotag 1.
// This way, the x/y coordinates where above/below water
// changes can happen are the same.
if (othersect >= 0 && sector[othersect].lotag==othertag)
{ {
int32_t k = 0; int32_t k = 0;