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

This commit is contained in:
Mitchell Richters 2023-10-03 22:36:13 +11:00 committed by Christoph Oelckers
parent c7c63413ce
commit 2197128dc4
4 changed files with 4 additions and 5 deletions

View file

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

View file

@ -647,9 +647,8 @@ int endoflevel(DDukePlayer* const p)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int timedexit(int snum) int timedexit(DDukePlayer* const p)
{ {
auto p = getPlayer(snum);
p->timebeforeexit--; p->timebeforeexit--;
if (p->timebeforeexit == 26 * 5) if (p->timebeforeexit == 26 * 5)
{ {

View file

@ -1631,7 +1631,7 @@ void processinput_d(int snum)
if (p->timebeforeexit > 1 && p->last_extra > 0) if (p->timebeforeexit > 1 && p->last_extra > 0)
{ {
if (timedexit(snum)) if (timedexit(p))
return; return;
} }

View file

@ -2443,7 +2443,7 @@ void processinput_r(int snum)
if (p->timebeforeexit > 1 && p->last_extra > 0) if (p->timebeforeexit > 1 && p->last_extra > 0)
{ {
if (timedexit(snum)) if (timedexit(p))
return; return;
} }