- use sectnum and wallnum to get an index from pointers instead of subtracting the array base.

This commit is contained in:
Christoph Oelckers 2021-11-11 20:20:00 +01:00
parent 3a259c9c46
commit adf3133fdc
24 changed files with 81 additions and 78 deletions

View file

@ -1442,8 +1442,8 @@ void DoPlayerSetWadeDepth(PLAYERp pp)
if (TEST(sectp->extra, SECTFX_SINK))
{
// make sure your even in the water
if (pp->posz + PLAYER_HEIGHT > pp->lo_sectp->floorz - Z(FixedToInt(SectUser[pp->lo_sectp - sector]->depth_fixed)))
pp->WadeDepth = FixedToInt(SectUser[pp->lo_sectp - sector]->depth_fixed);
if (pp->posz + PLAYER_HEIGHT > pp->lo_sectp->floorz - Z(FixedToInt(SectUser[sectnum(pp->lo_sectp)]->depth_fixed)))
pp->WadeDepth = FixedToInt(SectUser[sectnum(pp->lo_sectp)]->depth_fixed);
}
}