diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 734e0a2ce..9f42345a9 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -375,7 +375,7 @@ void GameInterface::Ticker() // disable synchronised input if set by game. resetForcedSyncInput(); - auto& lPlayerVel = sPlayerInput[nLocalPlayer].vel; + auto& lPlayerVel = PlayerList[nLocalPlayer].pActor->vel.XY(); auto inputvect = DVector2(localInput.fvel, localInput.svel).Rotated(inita) * 0.375; diff --git a/source/games/exhumed/src/input.cpp b/source/games/exhumed/src/input.cpp index 988eba81f..479aa5b7c 100644 --- a/source/games/exhumed/src/input.cpp +++ b/source/games/exhumed/src/input.cpp @@ -68,9 +68,9 @@ void GameInterface::GetInput(ControlInfo* const hidInput, double const scaleAdju { processMovement(&input, &localInput, hidInput, scaleAdjust); } - else + else if (pPlayer->pActor) { - sPlayerInput[nLocalPlayer].vel.Zero(); + pPlayer->pActor->vel.Zero(); } if (!SyncInput() && gamestate == GS_LEVEL && !nFreeze) diff --git a/source/games/exhumed/src/input.h b/source/games/exhumed/src/input.h index 6467df723..75e17b46f 100644 --- a/source/games/exhumed/src/input.h +++ b/source/games/exhumed/src/input.h @@ -32,7 +32,6 @@ enum { // 32 bytes struct PlayerInput { - DVector2 vel; float nAngle; float pan; ESyncBits actions; diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 9377a5330..a982cfe13 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -855,7 +855,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort { PlayerList[nPlayer].pPlayerPushSect = sect; - DVector2 vel = sPlayerInput[nPlayer].vel; + DVector2 vel = PlayerList[nPlayer].pActor->vel.XY(); auto nMyAngle = vel.Angle().Normalized360(); setsectinterpolate(sect); @@ -906,8 +906,6 @@ void AIPlayer::Tick(RunListEvent* ev) int nAction = PlayerList[nPlayer].nAction; int nActionB = PlayerList[nPlayer].nAction; - pPlayerActor->vel.XY() = sPlayerInput[nPlayer].vel; - if (PlayerList[nPlayer].nCurrentItem > -1) { UseItem(nPlayer, PlayerList[nPlayer].nCurrentItem); @@ -1006,7 +1004,7 @@ void AIPlayer::Tick(RunListEvent* ev) auto playerPos = pPlayerActor->spr.pos.XY(); - DVector2 vect = sPlayerInput[nPlayer].vel; + DVector2 vect = pPlayerActor->vel.XY(); double zz = pPlayerActor->vel.Z; if (pPlayerActor->vel.Z > 32) @@ -1074,7 +1072,6 @@ void AIPlayer::Tick(RunListEvent* ev) pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle); pPlayerActor->backupang(); - sPlayerInput[nPlayer].vel.Zero(); pPlayerActor->vel.Zero(); if (nFreeze < 1)