diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index e4ae52c72..7e93186b8 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -101,7 +101,7 @@ int timedexit(int snum); void dokneeattack(DDukePlayer* const p); int endoflevel(int snum); void playerisdead(int snum, int psectlotag, double fz, double cz); -void footprints(int snum); +void footprints(DDukePlayer* const p); int makepainsounds(DDukePlayer* const p, int type); void playerCrouch(int snum); void playerJump(int snum, double fz, double cz); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 9e4729551..259e7c7db 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -484,9 +484,8 @@ int makepainsounds(DDukePlayer* const p, int type) // //--------------------------------------------------------------------------- -void footprints(int snum) +void footprints(DDukePlayer* const p) { - auto p = getPlayer(snum); auto actor = p->GetActor(); if (p->footprintcount > 0 && p->on_ground) @@ -497,8 +496,8 @@ void footprints(int snum) while (auto act = it.Next()) { if (act->IsKindOf(DukeFootprintsClass)) - if (abs(act->spr.pos.X - p->GetActor()->spr.pos.X) < 24) - if (abs(act->spr.pos.Y - p->GetActor()->spr.pos.Y) < 24) + if (abs(act->spr.pos.X - actor->spr.pos.X) < 24) + if (abs(act->spr.pos.Y - actor->spr.pos.Y) < 24) { j = 1; break; @@ -512,7 +511,7 @@ void footprints(int snum) DDukeActor* fprint = spawn(actor, DukeFootprintsClass); if (fprint) { - fprint->spr.Angles.Yaw = p->GetActor()->spr.Angles.Yaw; + fprint->spr.Angles.Yaw = actor->spr.Angles.Yaw; fprint->spr.pal = p->footprintpal; fprint->spr.shade = (int8_t)p->footprintshade; } diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index b8b909f71..3b073f2fb 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -683,7 +683,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo } else { - footprints(snum); + footprints(p); } if (pact->getOffsetZ() < floorz - i) //falling diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index da9b714f7..2b045fc9f 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -1163,7 +1163,7 @@ static void movement(int snum, ESyncBits actions, sectortype* psect, double floo } else if (!p->OnMotorcycle) { - footprints(snum); + footprints(p); } if (pact->getOffsetZ() < floorz - i) //falling