diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 6853e364c..2a290f46b 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -119,7 +119,7 @@ void checkweapons(DDukePlayer* const p); int findotherplayer(int p, double* d); void quickkill(DDukePlayer* p); int setpal(DDukePlayer* p); -int haslock(sectortype* sect, int snum); +int haslock(sectortype* sect, DDukePlayer* const p); void purplelavacheck(DDukePlayer* p); void addphealth(DDukePlayer* p, int amount, bool bigitem); int playereat(DDukePlayer* p, int amount, bool bigitem); diff --git a/source/games/duke/src/player.cpp b/source/games/duke/src/player.cpp index 2f318ee6a..5d017ba7a 100644 --- a/source/games/duke/src/player.cpp +++ b/source/games/duke/src/player.cpp @@ -999,9 +999,8 @@ bool movementBlocked(DDukePlayer *p) // //--------------------------------------------------------------------------- -int haslock(sectortype* sectp, int snum) +int haslock(sectortype* sectp, DDukePlayer* const p) { - auto p = getPlayer(snum); if (!sectp) return 0; if (!sectp->lockinfo) diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 50e98169c..a0bd9ffda 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -368,7 +368,7 @@ void checksectors_r(int snum) if (isactivator(act) || ismasterswitch(act)) return; } - if (haslock(near.hitSector, snum)) + if (haslock(near.hitSector, p)) operatesectors(near.hitSector, p->GetActor()); else { @@ -389,7 +389,7 @@ void checksectors_r(int snum) if (isactivator(act) || ismasterswitch(act)) return; } - if (haslock(near.hitSector, snum)) + if (haslock(near.hitSector, p)) operatesectors(p->GetActor()->sector(), p->GetActor()); else {