From 82e0e25b7ecfb2cd510f342349a8b6a363ad517b Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 16 Nov 2022 13:50:54 +1100 Subject: [PATCH] - SW: Manual fixes to last commit I wanted to keep separate. --- source/games/sw/src/player.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 6d1d5c9dd..0923f5617 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1401,7 +1401,11 @@ void DoPlayerWarpTeleporter(PLAYER* pp) TAG 5 to 8 = random match locations #endif - if ((act_warp = Warp(pp->posGet(), &pp->cursector)) == nullptr) + auto pos = pp->posGet(); + act_warp = Warp(pos, &pp->cursector); + pp->posSet(pos); + + if (act_warp == nullptr) { return; } @@ -2222,7 +2226,11 @@ void DoPlayerMove(PLAYER* pp) } // check for warp - probably can remove from CeilingHit - if (WarpPlane(pp->posGet(), &pp->cursector)) + auto pos = pp->posGet(); + auto res = WarpPlane(pos, &pp->cursector); + pp->posSet(pos); + + if (res) { PlayerWarpUpdatePos(pp); } @@ -3498,7 +3506,11 @@ void DoPlayerClimb(PLAYER* pp) LadderUpdate = true; } - if (WarpPlane(pp->posGet(), &pp->cursector)) + auto pos = pp->posGet(); + auto res = WarpPlane(pos, &pp->cursector); + pp->posSet(pos); + + if (res) { PlayerWarpUpdatePos(pp); LadderUpdate = true;