diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 31f35a9c4..ba69a9bf2 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -98,7 +98,7 @@ int wakeup(DDukeActor* sn, DDukePlayer* const p); int timedexit(int snum); -void dokneeattack(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); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 5aa3c2efb..e67330e27 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -362,9 +362,8 @@ DDukeActor* aim_(DDukeActor* actor, DDukeActor* weapon, double aimangle, bool* b // //--------------------------------------------------------------------------- -void dokneeattack(int snum) +void dokneeattack(DDukePlayer* const p) { - auto p = getPlayer(snum); auto pact = p->GetActor(); if (p->knee_incs > 0) @@ -393,7 +392,7 @@ void dokneeattack(int snum) if (p->actorsqu->isPlayer()) { quickkill(getPlayer(p->actorsqu->PlayerIndex())); - getPlayer(p->actorsqu->PlayerIndex())->frag_ps = snum; + getPlayer(p->actorsqu->PlayerIndex())->frag_ps = p->pnum; } else { diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index 3acd7984f..f998c62f1 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1955,7 +1955,7 @@ HORIZONLY: } } - dokneeattack(snum); + dokneeattack(p); if (fi.doincrements(p)) return; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index b0d03ae23..7f4ecfea1 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -2908,7 +2908,7 @@ HORIZONLY: return; } } - dokneeattack(snum); + dokneeattack(p); if (fi.doincrements(p)) return;