From 05de974080d76b55107708a856421e6f343d9a56 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 30 Dec 2021 17:36:46 +1100 Subject: [PATCH] - SW: Replace `PLAYERstruct` `ly` with `LadderPosition.Y` calls. --- source/games/sw/src/game.h | 1 - source/games/sw/src/player.cpp | 16 ++++++++-------- source/games/sw/src/save.cpp | 2 +- wadsrc/static/zscript/games/sw/swgame.zs | 1 - 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 309bd14cf..7c4d72d1c 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -671,7 +671,6 @@ struct PLAYERstruct sectortype* LadderSector; 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 d9751592e..9ce29cddf 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -3183,15 +3183,15 @@ void DoPlayerClimb(PLAYERp pp) pp->pos.X = pp->LadderPosition.X; } - if (pp->pos.Y != pp->ly) + if (pp->pos.Y != pp->LadderPosition.Y) { - if (pp->pos.Y < pp->ly) + if (pp->pos.Y < pp->LadderPosition.Y) pp->pos.Y += ADJ_AMT; - else if (pp->pos.Y > pp->ly) + else if (pp->pos.Y > pp->LadderPosition.Y) pp->pos.Y -= ADJ_AMT; - if (labs(pp->pos.Y - pp->ly) <= ADJ_AMT) - pp->pos.Y = pp->ly; + if (labs(pp->pos.Y - pp->LadderPosition.Y) <= ADJ_AMT) + pp->pos.Y = pp->LadderPosition.Y; } // sprite @@ -3347,7 +3347,7 @@ void DoPlayerClimb(PLAYERp pp) // the sprite pp->LadderPosition.X = lActor->spr.pos.X + nx * 5; - pp->ly = lActor->spr.pos.Y + ny * 5; + pp->LadderPosition.Y = lActor->spr.pos.Y + ny * 5; pp->angle.settarget(lActor->spr.ang + 1024); } @@ -3729,7 +3729,7 @@ bool PlayerOnLadder(PLAYERp pp) // the sprite pp->LadderPosition.X = lActor->spr.pos.X + nx * 5; - pp->ly = lActor->spr.pos.Y + ny * 5; + pp->LadderPosition.Y = lActor->spr.pos.Y + ny * 5; pp->angle.settarget(lActor->spr.ang + 1024); @@ -7119,7 +7119,7 @@ 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, ly) +//DEFINE_FIELD_X(SWPlayer, PLAYERstruct, ly) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, JumpDuration) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, WadeDepth) DEFINE_FIELD_X(SWPlayer, PLAYERstruct, bob_amt) diff --git a/source/games/sw/src/save.cpp b/source/games/sw/src/save.cpp index d156c084a..6e61b898d 100644 --- a/source/games/sw/src/save.cpp +++ b/source/games/sw/src/save.cpp @@ -501,7 +501,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, PLAYERstruct& w, P ("pnum", w.pnum) ("LadderSector", w.LadderSector) ("lx", w.LadderPosition.X) - ("ly", w.ly) + ("ly", w.LadderPosition.Y) ("JumpDuration", w.JumpDuration) ("WadeDepth", w.WadeDepth) ("bob_amt", w.bob_amt) diff --git a/wadsrc/static/zscript/games/sw/swgame.zs b/wadsrc/static/zscript/games/sw/swgame.zs index 547088623..8a18cf189 100644 --- a/wadsrc/static/zscript/games/sw/swgame.zs +++ b/wadsrc/static/zscript/games/sw/swgame.zs @@ -226,7 +226,6 @@ struct SWPlayer native native int16 pnum; // carry along the player number //native int16 LadderSector; - native int ly; // ladder x and y native int16 JumpDuration; native int16 WadeDepth; native int16 bob_amt;