diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 0dd2a7934..309bd14cf 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -670,7 +670,8 @@ struct PLAYERstruct int16_t pnum; // carry along the player number 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 WadeDepth; int16_t bob_amt; diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index b0b6735fe..d9751592e 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -3172,15 +3172,15 @@ void DoPlayerClimb(PLAYERp pp) const int ADJ_AMT = 8; // 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; - else if (pp->pos.X > pp->lx) + else if (pp->pos.X > pp->LadderPosition.X) pp->pos.X -= ADJ_AMT; - if (labs(pp->pos.X - pp->lx) <= ADJ_AMT) - pp->pos.X = pp->lx; + if (labs(pp->pos.X - pp->LadderPosition.X) <= ADJ_AMT) + pp->pos.X = pp->LadderPosition.X; } 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 // 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->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 // 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->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, pnum) 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, JumpDuration) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WadeDepth) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index 516e5803b..d156c084a 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -500,7 +500,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P ("PlayerUnderSprite", w.PlayerUnderActor) ("pnum", w.pnum) ("LadderSector", w.LadderSector) - ("lx", w.lx) + ("lx", w.LadderPosition.X) ("ly", w.ly) ("JumpDuration", w.JumpDuration) ("WadeDepth", w.WadeDepth) diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 73c236fce..547088623 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -226,7 +226,7 @@ struct SWPlayer native native int16 pnum; // carry along the player number //native int16 LadderSector; - native int lx,ly; // ladder x and y + native int ly; // ladder x and y native int16 JumpDuration; native int16 WadeDepth; native int16 bob_amt;