diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 86ca0fe01..bf3a3c2d2 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -750,6 +750,11 @@ struct PLAYER { return PlayerPrevPosition.XY(); } + + void posprevZset(const double val) + { + PlayerPrevPosition.Z = val; + } }; extern PLAYER Player[MAX_SW_PLAYERS_REG+1]; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 8b02dc172..098ec7af4 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -2221,7 +2221,7 @@ void DoPlayerMove(PLAYER* pp) if (interpolate_ride) { - pp->PlayerPrevPosition.Z = pp->posZget(); + pp->posprevZset(pp->posZget()); pp->angle.backup(); } @@ -7357,7 +7357,7 @@ void PlayerSpawnPosition(PLAYER* pp) if (pp->posZget() > fz - PLAYER_HEIGHTF) { pp->posZset(fz - PLAYER_HEIGHTF); - pp->PlayerPrevPosition.Z = pp->posZget(); + pp->posprevZset(pp->posZget()); } }