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

This commit is contained in:
Mitchell Richters 2023-10-03 22:29:33 +11:00
parent 0749a65c81
commit 079df4dd8f
4 changed files with 4 additions and 5 deletions

View file

@ -102,7 +102,7 @@ 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);
int makepainsounds(int snum, int type); int makepainsounds(DDukePlayer* const p, int type);
void playerCrouch(int snum); void playerCrouch(int snum);
void playerJump(int snum, double fz, double cz); void playerJump(int snum, double fz, double cz);

View file

@ -412,9 +412,8 @@ void dokneeattack(DDukePlayer* const p)
// //
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
int makepainsounds(int snum, int type) int makepainsounds(DDukePlayer* const p, int type)
{ {
auto p = getPlayer(snum);
auto actor = p->GetActor(); auto actor = p->GetActor();
int k = 0; int k = 0;

View file

@ -1728,7 +1728,7 @@ void processinput_d(int snum)
{ {
int surface = tilesurface(sect->floortexture); int surface = tilesurface(sect->floortexture);
int whichsound = surface == TSURF_ELECTRIC? 0 : surface == TSURF_SLIME? 1 : surface == TSURF_PLASMA? 2 : -1; int whichsound = surface == TSURF_ELECTRIC? 0 : surface == TSURF_SLIME? 1 : surface == TSURF_PLASMA? 2 : -1;
k = makepainsounds(snum, whichsound); k = makepainsounds(p, whichsound);
} }
if (k) if (k)

View file

@ -2555,7 +2555,7 @@ void processinput_r(int snum)
{ {
int surface = tilesurface(sect->floortexture); int surface = tilesurface(sect->floortexture);
int whichsound = surface == TSURF_ELECTRIC ? 0 : surface == TSURF_SLIME ? 1 : surface == TSURF_PLASMA ? 2 : surface == TSURF_MAGMA ? 3 : -1; int whichsound = surface == TSURF_ELECTRIC ? 0 : surface == TSURF_SLIME ? 1 : surface == TSURF_PLASMA ? 2 : surface == TSURF_MAGMA ? 3 : -1;
k = makepainsounds(snum, whichsound); k = makepainsounds(p, whichsound);
} }
if (k) if (k)