- SW: Replace PLAYERstruct lx with LadderPosition.X calls.

This commit is contained in:
Mitchell Richters 2021-12-30 17:36:27 +11:00
parent 9c1e54a148
commit a18fc5b66f
4 changed files with 12 additions and 11 deletions

View file

@ -670,7 +670,8 @@ struct PLAYERstruct
int16_t pnum; // carry along the player number int16_t pnum; // carry along the player number
sectortype* LadderSector; sectortype* LadderSector;
int lx,ly; // ladder x and y vec3_t LadderPosition; // ladder x and y
int ly; // ladder x and y
int16_t JumpDuration; int16_t JumpDuration;
int16_t WadeDepth; int16_t WadeDepth;
int16_t bob_amt; int16_t bob_amt;

View file

@ -3172,15 +3172,15 @@ void DoPlayerClimb(PLAYERp pp)
const int ADJ_AMT = 8; const int ADJ_AMT = 8;
// player // player
if (pp->pos.X != pp->lx) if (pp->pos.X != pp->LadderPosition.X)
{ {
if (pp->pos.X < pp->lx) if (pp->pos.X < pp->LadderPosition.X)
pp->pos.X += ADJ_AMT; pp->pos.X += ADJ_AMT;
else if (pp->pos.X > pp->lx) else if (pp->pos.X > pp->LadderPosition.X)
pp->pos.X -= ADJ_AMT; pp->pos.X -= ADJ_AMT;
if (labs(pp->pos.X - pp->lx) <= ADJ_AMT) if (labs(pp->pos.X - pp->LadderPosition.X) <= ADJ_AMT)
pp->pos.X = pp->lx; pp->pos.X = pp->LadderPosition.X;
} }
if (pp->pos.Y != pp->ly) if (pp->pos.Y != pp->ly)
@ -3346,7 +3346,7 @@ void DoPlayerClimb(PLAYERp pp)
// set players "view" distance from the ladder - needs to be farther than // set players "view" distance from the ladder - needs to be farther than
// the sprite // the sprite
pp->lx = lActor->spr.pos.X + nx * 5; pp->LadderPosition.X = lActor->spr.pos.X + nx * 5;
pp->ly = lActor->spr.pos.Y + ny * 5; pp->ly = lActor->spr.pos.Y + ny * 5;
pp->angle.settarget(lActor->spr.ang + 1024); pp->angle.settarget(lActor->spr.ang + 1024);
@ -3728,7 +3728,7 @@ bool PlayerOnLadder(PLAYERp pp)
// set players "view" distance from the ladder - needs to be farther than // set players "view" distance from the ladder - needs to be farther than
// the sprite // the sprite
pp->lx = lActor->spr.pos.X + nx * 5; pp->LadderPosition.X = lActor->spr.pos.X + nx * 5;
pp->ly = lActor->spr.pos.Y + ny * 5; pp->ly = lActor->spr.pos.Y + ny * 5;
pp->angle.settarget(lActor->spr.ang + 1024); pp->angle.settarget(lActor->spr.ang + 1024);
@ -7118,7 +7118,7 @@ DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveY)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveDeltaAng) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, RevolveDeltaAng)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, pnum) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, pnum)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, LadderSector) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, LadderSector)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lx) //DEFINE_FIELD_X(SWPlayer, PLAYERstruct, lx)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ly) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ly)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, JumpDuration) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, JumpDuration)
DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WadeDepth) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WadeDepth)

View file

@ -500,7 +500,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P
("PlayerUnderSprite", w.PlayerUnderActor) ("PlayerUnderSprite", w.PlayerUnderActor)
("pnum", w.pnum) ("pnum", w.pnum)
("LadderSector", w.LadderSector) ("LadderSector", w.LadderSector)
("lx", w.lx) ("lx", w.LadderPosition.X)
("ly", w.ly) ("ly", w.ly)
("JumpDuration", w.JumpDuration) ("JumpDuration", w.JumpDuration)
("WadeDepth", w.WadeDepth) ("WadeDepth", w.WadeDepth)

View file

@ -226,7 +226,7 @@ struct SWPlayer native
native int16 pnum; // carry along the player number native int16 pnum; // carry along the player number
//native int16 LadderSector; //native int16 LadderSector;
native int lx,ly; // ladder x and y native int ly; // ladder x and y
native int16 JumpDuration; native int16 JumpDuration;
native int16 WadeDepth; native int16 WadeDepth;
native int16 bob_amt; native int16 bob_amt;