From 29bf5e4ccef8a0599eb65b95f93c58890391d60a Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 17 Apr 2023 15:35:58 +1000 Subject: [PATCH] - Exhumed: Move `updatePlayerTarget()` call back to main ticker loop. * While it's cleaner in the AIPlayer ticker, AIRa requires its target set (which is done in this func also) and I don't know whether AIPlayer is ticked before AIRa is. --- source/games/exhumed/src/exhumed.cpp | 1 + source/games/exhumed/src/player.cpp | 1 - source/games/exhumed/src/player.h | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 66e32b7fa..b2fee526e 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -354,6 +354,7 @@ void GameInterface::Ticker() const auto pPlayer = &PlayerList[i]; pPlayer->Angles.resetCameraAngles(); pPlayer->input = playercmds[i].ucmd; + updatePlayerTarget(pPlayer); } GameMove(); diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index ba8d0633c..242ddb2af 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -1811,7 +1811,6 @@ static bool doPlayerInput(Player* const pPlayer) // updatePlayerAction() needs access to bUnderwater. updatePlayerViewSector(pPlayer, nMove, spr_pos, spr_vel, bUnderwater); updatePlayerFloorActor(pPlayer); - updatePlayerTarget(pPlayer); updatePlayerInventory(pPlayer); updatePlayerWeapon(pPlayer); updatePlayerAction(pPlayer, bUnderwater); diff --git a/source/games/exhumed/src/player.h b/source/games/exhumed/src/player.h index 994845cb6..895aa98ca 100644 --- a/source/games/exhumed/src/player.h +++ b/source/games/exhumed/src/player.h @@ -122,6 +122,7 @@ int GetPlayerFromActor(DExhumedActor* actor); void SetPlayerMummified(int nPlayer, int bIsMummified); int AddAmmo(int nPlayer, int nWeapon, int nAmmoAmount); void ShootStaff(int nPlayer); +void updatePlayerTarget(Player* const pPlayer); inline void doPlayerVertPanning(Player* const pPlayer, const double nDestVertPan) {