mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-19 07:01:09 +00:00
- SW: Remove all the player oldpos
stuff.
* This only had one valid use, for a bad setup in `DoPlayerRun()` where `DoPlayerBob()` was called before `DoPlayerMove()`.
This commit is contained in:
parent
703db0e3c3
commit
c43bde9b4d
4 changed files with 4 additions and 28 deletions
|
@ -1708,8 +1708,6 @@ BEGIN_SW_NS
|
|||
|
||||
struct PLAYER
|
||||
{
|
||||
DVector3 PlayerOldPosition;
|
||||
|
||||
DSWActor* actor; // this may not be a TObjPtr!
|
||||
TObjPtr<DSWActor*> lowActor, highActor;
|
||||
TObjPtr<DSWActor*> remoteActor;
|
||||
|
@ -1890,21 +1888,6 @@ struct PLAYER
|
|||
return actor->viewzoffset + height;
|
||||
}
|
||||
|
||||
|
||||
DVector2& posoldXY()
|
||||
{
|
||||
return PlayerOldPosition.XY();
|
||||
}
|
||||
|
||||
void posoldSet(const DVector3& val)
|
||||
{
|
||||
PlayerOldPosition = val;
|
||||
}
|
||||
DVector3 posoldGet()
|
||||
{
|
||||
return PlayerOldPosition;
|
||||
}
|
||||
|
||||
void setHeightAndZ(const double newz, const double newheight)
|
||||
{
|
||||
actor->spr.pos.Z = newz;
|
||||
|
|
|
@ -1314,7 +1314,6 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
|||
pp->angle.ang = pp->angle.oang = ang;
|
||||
pp->actor->spr.pos = pos;
|
||||
pp->actor->backuppos();
|
||||
pp->posoldXY() = pp->actor->spr.pos.XY();
|
||||
|
||||
updatesector(pp->actor->getPosWithOffsetZ(), &pp->cursector);
|
||||
pp->Flags2 |= (PF2_TELEPORTED);
|
||||
|
@ -1328,7 +1327,6 @@ void DoPlayerTeleportToSprite(PLAYER* pp, DVector3& pos, DAngle ang)
|
|||
|
||||
void DoPlayerTeleportToOffset(PLAYER* pp)
|
||||
{
|
||||
pp->posoldXY() = pp->actor->spr.pos.XY();
|
||||
pp->actor->backupvec2();
|
||||
|
||||
updatesector(pp->actor->getPosWithOffsetZ(), &pp->cursector);
|
||||
|
@ -1693,7 +1691,7 @@ void DoPlayerBob(PLAYER* pp)
|
|||
{
|
||||
double amt;
|
||||
|
||||
double dist = (pp->actor->spr.pos.XY() - pp->posoldXY()).Length();
|
||||
double dist = (pp->actor->spr.pos.XY() - pp->actor->opos.XY()).Length();
|
||||
|
||||
if (dist > 32)
|
||||
dist = 0;
|
||||
|
@ -2026,7 +2024,7 @@ void PlayerCheckValidMove(PLAYER* pp)
|
|||
{
|
||||
if (!pp->insector())
|
||||
{
|
||||
pp->actor->spr.pos = pp->posoldGet().plusZ(-pp->actor->viewzoffset);
|
||||
pp->actor->restorepos();
|
||||
pp->cursector = pp->lastcursector;
|
||||
}
|
||||
}
|
||||
|
@ -2090,7 +2088,6 @@ void DoPlayerMove(PLAYER* pp)
|
|||
DoPlayerTurn(pp, pp->input.avel, 1);
|
||||
}
|
||||
|
||||
pp->posoldSet(pp->actor->getPosWithOffsetZ());
|
||||
pp->lastcursector = pp->cursector;
|
||||
|
||||
if (PLAYER_MOVING(pp) == 0)
|
||||
|
@ -6568,8 +6565,6 @@ void DoPlayerRun(PLAYER* pp)
|
|||
}
|
||||
}
|
||||
|
||||
DoPlayerBob(pp);
|
||||
|
||||
if (pp->WadeDepth)
|
||||
{
|
||||
DoPlayerBeginWade(pp);
|
||||
|
@ -6616,6 +6611,8 @@ void DoPlayerRun(PLAYER* pp)
|
|||
pp->setHeightAndZ(pp->loz, PLAYER_HEIGHTF);
|
||||
}
|
||||
|
||||
DoPlayerBob(pp);
|
||||
|
||||
// Adjust height moving up and down sectors
|
||||
DoPlayerHeight(pp);
|
||||
}
|
||||
|
|
|
@ -480,9 +480,6 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYER& w, PLAYER*
|
|||
("recoil_ndx", w.recoil_ndx)
|
||||
("recoil_horizoff", w.recoil_horizoff)
|
||||
("recoil_ohorizoff", w.recoil_ohorizoff)
|
||||
("oldposx", w.PlayerOldPosition.X)
|
||||
("oldposy", w.PlayerOldPosition.Y)
|
||||
("oldposz", w.PlayerOldPosition.Z)
|
||||
("revolvex", w.Revolve.X)
|
||||
("revolvey", w.Revolve.Y)
|
||||
("RevolveDeltaAng", w.RevolveDeltaAng)
|
||||
|
|
|
@ -1544,7 +1544,6 @@ void PreMapCombineFloors(void)
|
|||
if (itsect == dasect)
|
||||
{
|
||||
pp->actor->spr.pos.XY() += dv;
|
||||
pp->posoldXY() = pp->actor->spr.pos.XY();
|
||||
pp->actor->backupvec2();
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue