From ff0c17d7f8586dfe870ab275c71b81633a2364f8 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 30 Aug 2015 21:53:22 +1000 Subject: [PATCH] Fix campcheck damaging players when it shouldn't (while typing, before match begins etc) --- qcsrc/server/mutators/mutator_campcheck.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/mutators/mutator_campcheck.qc b/qcsrc/server/mutators/mutator_campcheck.qc index bacc590b7..2839ae09b 100644 --- a/qcsrc/server/mutators/mutator_campcheck.qc +++ b/qcsrc/server/mutators/mutator_campcheck.qc @@ -9,7 +9,7 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerDies) { - Kill_Notification(NOTIF_ONE_ONLY, self, MSG_CENTER_CPID, CPID_CAMPCHECK); + Kill_Notification(NOTIF_ONE, self, MSG_CENTER_CPID, CPID_CAMPCHECK); return false; } @@ -29,9 +29,14 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerDamage) MUTATOR_HOOKFUNCTION(campcheck_PlayerThink) { + if(!gameover) + if(!warmup_stage) // don't consider it camping during warmup? + if(time >= game_starttime) if(IS_PLAYER(self)) + if(IS_REAL_CLIENT(self)) // bots may camp, but that's no reason to constantly kill them if(self.deadflag == DEAD_NO) if(!self.frozen) + if(!self.BUTTON_CHAT) if(autocvar_g_campcheck_interval) { vector dist; @@ -60,8 +65,11 @@ MUTATOR_HOOKFUNCTION(campcheck_PlayerThink) self.campcheck_nextcheck = time + autocvar_g_campcheck_interval; self.campcheck_traveled_distance = 0; } + + return false; } + self.campcheck_nextcheck = time + autocvar_g_campcheck_interval; // one of the above checks failed, so keep the timer up to date return false; } -- 2.39.2