- SW: Wrap calls to PLAYER::PlayerPrevPosition.XY().

This commit is contained in:
Mitchell Richters 2022-11-16 13:55:07 +11:00 committed by Christoph Oelckers
parent 82e0e25b7e
commit bf833fcfa3
3 changed files with 9 additions and 4 deletions

View file

@ -745,6 +745,11 @@ struct PLAYER
{
return PlayerNowPosition;
}
DVector2& posprevXY()
{
return PlayerPrevPosition.XY();
}
};
extern PLAYER Player[MAX_SW_PLAYERS_REG+1];

View file

@ -1328,7 +1328,7 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
void DoPlayerTeleportToOffset(PLAYER* pp)
{
pp->PlayerOldPosition.XY() = pp->PlayerPrevPosition.XY() = pp->posXY();
pp->PlayerOldPosition.XY() = pp->posprevXY() = pp->posXY();
updatesector(pp->posGet(), &pp->cursector);
pp->Flags2 |= (PF2_TELEPORTED);
@ -2167,7 +2167,7 @@ void DoPlayerMove(PLAYER* pp)
auto sect = pp->cursector;
if (interpolate_ride)
{
pp->PlayerPrevPosition.XY() = pp->posXY();
pp->posprevXY() = pp->posXY();
}
pp->posAdd(pp->vect);
updatesector(pp->posGet(), &sect);
@ -2192,7 +2192,7 @@ void DoPlayerMove(PLAYER* pp)
if (interpolate_ride)
{
pp->PlayerPrevPosition.XY() = pp->posXY();
pp->posprevXY() = pp->posXY();
}
auto save_cstat = actor->spr.cstat;

View file

@ -1544,7 +1544,7 @@ void PreMapCombineFloors(void)
if (itsect == dasect)
{
pp->posAdd(dv);
pp->PlayerPrevPosition.XY() = pp->PlayerOldPosition.XY() = pp->posXY();
pp->posprevXY() = pp->PlayerOldPosition.XY() = pp->posXY();
break;
}
}