mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-26 22:11:54 +00:00
- Duke: Clean up player/actor accesses in playerisdead()
.
This commit is contained in:
parent
7186c3e9f7
commit
497d2d26dd
4 changed files with 11 additions and 11 deletions
|
@ -100,7 +100,7 @@ int wakeup(DDukeActor* sn, DDukePlayer* const p);
|
|||
int timedexit(int snum);
|
||||
void dokneeattack(DDukePlayer* const p);
|
||||
int endoflevel(int snum);
|
||||
void playerisdead(int snum, int psectlotag, double fz, double cz);
|
||||
void playerisdead(DDukePlayer* const p, int psectlotag, double fz, double cz);
|
||||
void footprints(DDukePlayer* const p);
|
||||
int makepainsounds(DDukePlayer* const p, int type);
|
||||
void playerCrouch(int snum);
|
||||
|
|
|
@ -526,13 +526,12 @@ void footprints(DDukePlayer* const p)
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
|
||||
void playerisdead(DDukePlayer* const p, int psectlotag, double floorz, double ceilingz)
|
||||
{
|
||||
auto p = getPlayer(snum);
|
||||
auto actor = p->GetActor();
|
||||
|
||||
// lock input when dead.
|
||||
setForcedSyncInput(snum);
|
||||
setForcedSyncInput(p->pnum);
|
||||
|
||||
if (p->dead_flag == 0)
|
||||
{
|
||||
|
@ -560,13 +559,14 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
|
|||
|
||||
if (ud.multimode > 1 && (actor->spr.pal != 1 || (actor->spr.cstat & CSTAT_SPRITE_INVISIBLE)))
|
||||
{
|
||||
if (p->frag_ps != snum)
|
||||
if (p->frag_ps != p->pnum)
|
||||
{
|
||||
getPlayer(p->frag_ps)->frag++;
|
||||
getPlayer(p->frag_ps)->frags[snum]++;
|
||||
const auto fragp = getPlayer(p->frag_ps);
|
||||
fragp->frag++;
|
||||
fragp->frags[p->pnum]++;
|
||||
|
||||
auto pname = PlayerName(p->frag_ps);
|
||||
if (snum == screenpeek)
|
||||
if (p->pnum == screenpeek)
|
||||
{
|
||||
Printf(PRINT_NOTIFY, "Killed by %s", pname);
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
|
|||
}
|
||||
else p->fraggedself++;
|
||||
|
||||
p->frag_ps = snum;
|
||||
p->frag_ps = p->pnum;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1637,7 +1637,7 @@ void processinput_d(int snum)
|
|||
|
||||
if (pact->spr.extra <= 0 && !ud.god)
|
||||
{
|
||||
playerisdead(snum, psectlotag, floorz, ceilingz);
|
||||
playerisdead(p, psectlotag, floorz, ceilingz);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -2449,7 +2449,7 @@ void processinput_r(int snum)
|
|||
|
||||
if (pact->spr.extra <= 0 && !ud.god)
|
||||
{
|
||||
playerisdead(snum, psectlotag, floorz, ceilingz);
|
||||
playerisdead(p, psectlotag, floorz, ceilingz);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue