From: Mario Date: Sun, 30 Aug 2015 11:53:22 +0000 (+1000) Subject: Fix campcheck damaging players when it shouldn't (while typing, before match begins... X-Git-Tag: xonotic-v0.8.2~1959 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ff0c17d7f8586dfe870ab275c71b81633a2364f8;p=xonotic%2Fxonotic-data.pk3dir.git Fix campcheck damaging players when it shouldn't (while typing, before match begins etc) --- 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; }