Fix underwater player clipping issue

git-svn-id: https://svn.eduke32.com/eduke32@7468 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-03-30 20:46:07 +00:00 committed by Christoph Oelckers
parent 1ea1f525d9
commit 3926ae2d4f

View file

@ -4498,6 +4498,21 @@ static void P_DoWater(int const playerNum, int const playerBits, int const floor
pPlayer->vel.z = 0; pPlayer->vel.z = 0;
} }
int spriteNum;
for (SPRITES_OF_SECT(pPlayer->cursectnum, spriteNum))
if (sprite[spriteNum].statnum == STAT_TRANSPORT)
break;
if (spriteNum == -1)
{
if (pPlayer->pos.z < ceilZ + PMINHEIGHT)
{
pPlayer->pos.z = ceilZ + PMINHEIGHT;
pPlayer->vel.z = 0;
}
}
if (pPlayer->scuba_on && (krand()&255) < 8) if (pPlayer->scuba_on && (krand()&255) < 8)
{ {
int const spriteNum = A_Spawn(pPlayer->i, WATERBUBBLE); int const spriteNum = A_Spawn(pPlayer->i, WATERBUBBLE);