- Exhumed: Remove PlayerInput::vel in favour of just using actor's velocity.

This commit is contained in:
Mitchell Richters 2023-03-13 20:42:37 +11:00
parent 73acffac2c
commit 67c7dd65f9
4 changed files with 5 additions and 9 deletions

View file

@ -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;

View file

@ -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)

View file

@ -32,7 +32,6 @@ enum {
// 32 bytes
struct PlayerInput
{
DVector2 vel;
float nAngle;
float pan;
ESyncBits actions;

View file

@ -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)