diff --git a/source/games/duke/src/gameexec.cpp b/source/games/duke/src/gameexec.cpp index a2a7aa7d0..47a56eea8 100644 --- a/source/games/duke/src/gameexec.cpp +++ b/source/games/duke/src/gameexec.cpp @@ -388,7 +388,7 @@ void DoPlayer(bool bSet, int lVar1, int lLabelID, int lVar2, DDukeActor* sActor, break; case PLAYER_OPOSZ: - if (bSet) ps[iPlayer].PlayerOldPosition.Z = lValue * zmaptoworld; + if (bSet) ps[iPlayer].posoldZset(lValue * zmaptoworld); else SetGameVarID(lVar2, int(ps[iPlayer].PlayerOldPosition.Z * (1 / zmaptoworld)), sActor, sPlayer); break; diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 763a4f50b..2d02cea5e 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -774,7 +774,7 @@ void player_struct::backuppos(bool noclipping) posY() = posoldY(); } - PlayerOldPosition.Z = posZget(); + posoldZset(posZget()); bobpos = posXY(); opyoff = pyoff; } diff --git a/source/games/duke/src/types.h b/source/games/duke/src/types.h index 79ac53ae4..d6635169f 100644 --- a/source/games/duke/src/types.h +++ b/source/games/duke/src/types.h @@ -413,6 +413,11 @@ struct player_struct { return PlayerOldPosition.XY(); } + + void posoldZset(const double val) + { + PlayerOldPosition.Z = val; + } }; struct Cycler