From 3926ae2d4f4727d791d14b98b118c9d9c6a9b27c Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 30 Mar 2019 20:46:07 +0000 Subject: [PATCH] Fix underwater player clipping issue git-svn-id: https://svn.eduke32.com/eduke32@7468 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index afe0c8cac..5a8d6d5de 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -4498,6 +4498,21 @@ static void P_DoWater(int const playerNum, int const playerBits, int const floor 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) { int const spriteNum = A_Spawn(pPlayer->i, WATERBUBBLE);