]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix campcheck damaging players when it shouldn't (while typing, before match begins...
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 11:53:22 +0000 (21:53 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 11:53:22 +0000 (21:53 +1000)
qcsrc/server/mutators/mutator_campcheck.qc

index bacc590b78d731f3d639ae99cbf7cbbc3ef554f8..2839ae09b6e546ee01faa1adf04be0ed0fc39e90 100644 (file)
@@ -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;
 }