diff --git a/source/games/exhumed/src/exhumed.cpp b/source/games/exhumed/src/exhumed.cpp index 4d1c753ce..1a7025224 100644 --- a/source/games/exhumed/src/exhumed.cpp +++ b/source/games/exhumed/src/exhumed.cpp @@ -379,7 +379,7 @@ void GameInterface::Ticker() PlayerList[nLocalPlayer].input = playercmds[nLocalPlayer].ucmd; if (oldactions & SB_CENTERVIEW) PlayerList[nLocalPlayer].input.actions |= SB_CENTERVIEW; - auto& lPlayerVel = PlayerList[nLocalPlayer].pActor->vel.XY(); + auto& lPlayerVel = PlayerList[nLocalPlayer].vel; auto inputvect = DVector2(PlayerList[nLocalPlayer].input.fvel, PlayerList[nLocalPlayer].input.svel).Rotated(inita) * 0.375; diff --git a/source/games/exhumed/src/input.cpp b/source/games/exhumed/src/input.cpp index 5e95ba0d8..f227503dd 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 if (pPlayer->pActor) + else { - pPlayer->pActor->vel.Zero(); + pPlayer->vel.Zero(); } if (!SyncInput() && gamestate == GS_LEVEL && !nFreeze) diff --git a/source/games/exhumed/src/player.cpp b/source/games/exhumed/src/player.cpp index 56ef4ef50..1bf4923d2 100644 --- a/source/games/exhumed/src/player.cpp +++ b/source/games/exhumed/src/player.cpp @@ -854,7 +854,7 @@ bool CheckMovingBlocks(int nPlayer, Collision& nMove, DVector3& spr_pos, sectort { PlayerList[nPlayer].pPlayerPushSect = sect; - DVector2 vel = PlayerList[nPlayer].pActor->vel.XY(); + DVector2 vel = PlayerList[nPlayer].vel; auto nMyAngle = vel.Angle().Normalized360(); setsectinterpolate(sect); @@ -905,6 +905,8 @@ void AIPlayer::Tick(RunListEvent* ev) int nAction = PlayerList[nPlayer].nAction; int nActionB = PlayerList[nPlayer].nAction; + pPlayerActor->vel.XY() = PlayerList[nPlayer].vel; + if (PlayerList[nPlayer].nCurrentItem > -1) { UseItem(nPlayer, PlayerList[nPlayer].nCurrentItem); @@ -1003,7 +1005,7 @@ void AIPlayer::Tick(RunListEvent* ev) auto playerPos = pPlayerActor->spr.pos.XY(); - DVector2 vect = pPlayerActor->vel.XY(); + DVector2 vect = PlayerList[nPlayer].vel; double zz = pPlayerActor->vel.Z; if (pPlayerActor->vel.Z > 32) @@ -1071,6 +1073,7 @@ void AIPlayer::Tick(RunListEvent* ev) pPlayerActor->spr.Angles = DRotator(nullAngle, GetAngleToSprite(pPlayerActor, pSpiritSprite), nullAngle); pPlayerActor->backupang(); + PlayerList[nPlayer].vel.Zero(); pPlayerActor->vel.Zero(); if (nFreeze < 1) diff --git a/source/games/exhumed/src/player.h b/source/games/exhumed/src/player.h index f099f5436..1363c6b4b 100644 --- a/source/games/exhumed/src/player.h +++ b/source/games/exhumed/src/player.h @@ -81,6 +81,7 @@ struct Player InputPacket input; PlayerAngles Angles; + DVector2 vel; sectortype* pPlayerPushSect; sectortype* pPlayerViewSect;