- SW: Wrap remaining calls to PLAYER::PlayerOldPosition.

This commit is contained in:
Mitchell Richters 2022-11-17 18:25:46 +11:00 committed by Christoph Oelckers
parent 9ab5fd0801
commit 97a07cd83c
2 changed files with 12 additions and 4 deletions

View file

@ -769,6 +769,15 @@ struct PLAYER
{
return PlayerOldPosition.XY();
}
void posoldSet(const DVector3& val)
{
PlayerOldPosition = val;
}
DVector3 posoldGet()
{
return PlayerOldPosition;
}
};
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];

View file

@ -2055,7 +2055,7 @@ void PlayerCheckValidMove(PLAYER* pp)
{
if (!pp->insector())
{
pp->posSet(pp->PlayerOldPosition);
pp->posSet(pp->posoldGet());
pp->cursector = pp->lastcursector;
}
}
@ -2123,7 +2123,7 @@ void DoPlayerMove(PLAYER* pp)
DoPlayerTurn(pp, pp->input.avel, 1);
}
pp->PlayerOldPosition = pp->posGet();
pp->posoldSet(pp->posGet());
pp->lastcursector = pp->cursector;
if (PLAYER_MOVING(pp) == 0)
@ -7196,8 +7196,7 @@ void InitAllPlayers(void)
//pp->MaxHealth = 100;
pp->PlayerOldPosition.X = 0;
pp->PlayerOldPosition.Y = 0;
pp->posoldXY().Zero();
pp->climb_ndx = 10;
pp->KillerActor = nullptr;
pp->Kills = 0;