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

This commit is contained in:
Mitchell Richters 2022-11-16 14:09:31 +11:00 committed by Christoph Oelckers
parent f711355f2f
commit 9ab5fd0801
3 changed files with 9 additions and 4 deletions

View file

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

View file

@ -1314,7 +1314,7 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
pp->angle.ang = pp->angle.oang = ang;
pp->posSet(pos.plusZ(-PLAYER_HEIGHTF));
pp->posprevSet(pos.plusZ(-PLAYER_HEIGHTF));
pp->PlayerOldPosition.XY() = pp->posXY();
pp->posoldXY() = pp->posXY();
updatesector(pp->posGet(), &pp->cursector);
pp->Flags2 |= (PF2_TELEPORTED);
@ -1328,7 +1328,7 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
void DoPlayerTeleportToOffset(PLAYER* pp)
{
pp->PlayerOldPosition.XY() = pp->posprevXY() = pp->posXY();
pp->posoldXY() = pp->posprevXY() = pp->posXY();
updatesector(pp->posGet(), &pp->cursector);
pp->Flags2 |= (PF2_TELEPORTED);
@ -1703,7 +1703,7 @@ void DoPlayerBob(PLAYER* pp)
{
double amt;
double dist = (pp->posXY() - pp->PlayerOldPosition.XY()).Length();
double dist = (pp->posXY() - pp->posoldXY()).Length();
if (dist > 32)
dist = 0;

View file

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