From b83d321c4bcf1c6fd3cd6c3dedccf80ab8d3fce9 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 15 Dec 2022 18:04:16 +1100 Subject: [PATCH] - SW: Don't use `pp->setHeightAndZ()` when setting `PLAYER_CRAWL_HEIGHTF`. --- source/games/sw/src/player.cpp | 6 ++++-- source/games/sw/src/track.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 57176ecc3..209fceb73 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -3142,7 +3142,8 @@ void DoPlayerFall(PLAYER* pp) // i any kind of crawl key get rid of recoil if (DoPlayerTestCrawl(pp) || (pp->input.actions & SB_CROUCH)) { - pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF); + pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset; + pp->height = PLAYER_CRAWL_HEIGHTF; } else { @@ -3605,7 +3606,8 @@ void DoPlayerCrawl(PLAYER* pp) if (pp->insector() && (pp->cursector->extra & SECTFX_DYNAMIC_AREA)) { - pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF); + pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset; + pp->height = PLAYER_CRAWL_HEIGHTF; } DoPlayerBob(pp); diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index ab3a6eeb7..5c0b51b13 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1743,7 +1743,8 @@ PlayerPart: { // move up some for really fast moving plats DoPlayerZrange(pp); - pp->setHeightAndZ(pp->loz, PLAYER_CRAWL_HEIGHTF); + pp->actor->spr.pos.Z = pp->loz - PLAYER_CRAWL_HEIGHTF - pp->actor->viewzoffset; + pp->height = PLAYER_CRAWL_HEIGHTF; } else {