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

This commit is contained in:
Mitchell Richters 2023-10-03 22:27:32 +11:00
parent 2ff4aaf6b8
commit 0749a65c81
4 changed files with 5 additions and 6 deletions

View file

@ -98,7 +98,7 @@ int wakeup(DDukeActor* sn, DDukePlayer* const p);
int timedexit(int snum); int timedexit(int snum);
void dokneeattack(int snum); void dokneeattack(DDukePlayer* const p);
int endoflevel(int snum); int endoflevel(int snum);
void playerisdead(int snum, int psectlotag, double fz, double cz); void playerisdead(int snum, int psectlotag, double fz, double cz);
void footprints(int snum); void footprints(int snum);

View file

@ -362,9 +362,8 @@ DDukeActor* aim_(DDukeActor* actor, DDukeActor* weapon, double aimangle, bool* b
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void dokneeattack(int snum) void dokneeattack(DDukePlayer* const p)
{ {
auto p = getPlayer(snum);
auto pact = p->GetActor(); auto pact = p->GetActor();
if (p->knee_incs > 0) if (p->knee_incs > 0)
@ -393,7 +392,7 @@ void dokneeattack(int snum)
if (p->actorsqu->isPlayer()) if (p->actorsqu->isPlayer())
{ {
quickkill(getPlayer(p->actorsqu->PlayerIndex())); quickkill(getPlayer(p->actorsqu->PlayerIndex()));
getPlayer(p->actorsqu->PlayerIndex())->frag_ps = snum; getPlayer(p->actorsqu->PlayerIndex())->frag_ps = p->pnum;
} }
else else
{ {

View file

@ -1955,7 +1955,7 @@ HORIZONLY:
} }
} }
dokneeattack(snum); dokneeattack(p);
if (fi.doincrements(p)) return; if (fi.doincrements(p)) return;

View file

@ -2908,7 +2908,7 @@ HORIZONLY:
return; return;
} }
} }
dokneeattack(snum); dokneeattack(p);
if (fi.doincrements(p)) return; if (fi.doincrements(p)) return;