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

This commit is contained in:
Mitchell Richters 2023-10-03 22:37:00 +11:00 committed by Christoph Oelckers
parent 55c150845c
commit c7c63413ce
4 changed files with 4 additions and 6 deletions

View file

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

View file

@ -620,10 +620,8 @@ void playerisdead(DDukePlayer* const p, int psectlotag, double floorz, double ce
//
//---------------------------------------------------------------------------
int endoflevel(int snum)
int endoflevel(DDukePlayer* const p)
{
auto p = getPlayer(snum);
// the fist puching the end-of-level thing...
p->ofist_incs = p->fist_incs;
p->fist_incs++;

View file

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

View file

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