From 2d351b2c28557ce85ec4c64e0f0607dbe7b94330 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 16 Nov 2022 14:04:19 +1100 Subject: [PATCH] - SW: Wrap calls that set `PLAYER::PlayerPrevPosition.Z`. --- source/games/sw/src/game.h | 5 +++++ source/games/sw/src/player.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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()); } }