]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix double score for killing re-spawned zombies
authorMario <mario.mario@y7mail.com>
Mon, 2 Sep 2013 01:16:35 +0000 (11:16 +1000)
committerMario <mario.mario@y7mail.com>
Mon, 2 Sep 2013 01:16:35 +0000 (11:16 +1000)
qcsrc/server/mutators/gamemode_invasion.qc

index ab8bbd2f74211ddd952255e9fe711d44f63ca66c..fc3677b20331be5f9620e7c78c098a1fedcece25 100644 (file)
@@ -169,11 +169,14 @@ void Invasion_RoundStart()
 
 MUTATOR_HOOKFUNCTION(invasion_MonsterDies)
 {
-       numkilled += 1;
-       maxcurrent -= 1;
+       if not(self.monster_respawned)
+       {
+               numkilled += 1;
+               maxcurrent -= 1;
        
-       if(IS_PLAYER(frag_attacker))
-               PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+               if(IS_PLAYER(frag_attacker))
+                       PlayerScore_Add(frag_attacker, SP_KILLS, +1);
+       }
        
        return FALSE;
 }
@@ -188,8 +191,11 @@ MUTATOR_HOOKFUNCTION(invasion_MonsterSpawn)
                return FALSE;
        }
        
-       numspawned += 1;
-       maxcurrent += 1;
+       if not(self.monster_respawned)
+       {
+               numspawned += 1;
+               maxcurrent += 1;
+       }
        
        self.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_BOTCLIP | DPCONTENTS_MONSTERCLIP;