- Duke: Clean up player/actor accesses in movement().

This commit is contained in:
Mitchell Richters 2023-10-04 10:20:07 +11:00 committed by Christoph Oelckers
parent 7dc0bde2be
commit 58a87b658c
2 changed files with 4 additions and 6 deletions

View file

@ -641,10 +641,9 @@ static void operateJetpack(DDukePlayer* const p, ESyncBits actions, int psectlot
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void movement(int snum, ESyncBits actions, sectortype* psect, double floorz, double ceilingz, int shrunk, double truefdist, int psectlotag) static void movement(DDukePlayer* const p, ESyncBits actions, sectortype* psect, double floorz, double ceilingz, int shrunk, double truefdist, int psectlotag)
{ {
int j; int j;
auto p = getPlayer(snum);
auto pact = p->GetActor(); auto pact = p->GetActor();
if (p->airleft != 15 * 26) if (p->airleft != 15 * 26)
@ -1700,7 +1699,7 @@ void processinput_d(int snum)
} }
else if (psectlotag != ST_2_UNDERWATER) else if (psectlotag != ST_2_UNDERWATER)
{ {
movement(snum, actions, psectp, floorz, ceilingz, shrunk, truefdist, psectlotag); movement(p, actions, psectp, floorz, ceilingz, shrunk, truefdist, psectlotag);
} }
p->psectlotag = psectlotag; p->psectlotag = psectlotag;

View file

@ -1112,9 +1112,8 @@ static void onBoat(int snum, ESyncBits &actions)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
static void movement(int snum, ESyncBits actions, sectortype* psect, double floorz, double ceilingz, int shrunk, double truefdist, int psectlotag) static void movement(DDukePlayer* const p, ESyncBits actions, sectortype* psect, double floorz, double ceilingz, int shrunk, double truefdist, int psectlotag)
{ {
auto p = getPlayer(snum);
auto pact = p->GetActor(); auto pact = p->GetActor();
if (p->airleft != 15 * 26) if (p->airleft != 15 * 26)
@ -2528,7 +2527,7 @@ void processinput_r(int snum)
} }
else else
{ {
movement(snum, actions, psectp, floorz, ceilingz, shrunk, truefdist, psectlotag); movement(p, actions, psectp, floorz, ceilingz, shrunk, truefdist, psectlotag);
} }
p->psectlotag = psectlotag; p->psectlotag = psectlotag;