]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Don't reset generator health at round start
authorMario <mario.mario@y7mail.com>
Fri, 17 May 2013 15:18:20 +0000 (01:18 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 17 May 2013 15:18:20 +0000 (01:18 +1000)
qcsrc/server/mutators/gamemode_towerdefense.qc

index fc3db63d81e4d85db1a2f26cfe1bd321c2d4868f..79142d030aa78b2f0666f6023200a879cffe6a1e 100644 (file)
@@ -125,9 +125,6 @@ void td_generator_damage(entity inflictor, entity attacker, float damage, float
 void td_generator_reset()
 {
        self.SendFlags |= GSF_SETUP;
-       self.health = self.max_health;
-       
-       WaypointSprite_UpdateHealth(self.sprite, self.health);
 }
 
 void td_generator_setup()
@@ -314,6 +311,8 @@ void spawn_td_fuel(float fuel_size)
 void TD_RoundStart()
 {
        allowed_to_spawn = TRUE;
+       
+       total_killed = 0;
 }
 
 void TD_count_alive_monsters()
@@ -321,6 +320,8 @@ void TD_count_alive_monsters()
        entity head;
        
        total_alive = 0;
+       redalive = 0;
+       bluealive = 0;
        
        FOR_EACH_MONSTER(head)
        {
@@ -330,10 +331,8 @@ void TD_count_alive_monsters()
                
                switch(head.team)
                {
-                       case NUM_TEAM_1:
-                               ++redalive;
-                       case NUM_TEAM_2:
-                               ++bluealive;
+                       case NUM_TEAM_1: ++redalive; break;
+                       case NUM_TEAM_2: ++bluealive; break;
                }
        }
 }
@@ -365,7 +364,9 @@ float TD_CheckWinner()
        
        TD_count_alive_monsters();
        
-       if(total_alive < max_alive && time >= last_check && total_killed < max_monsters)
+       if(time >= last_check)
+       if(total_alive < max_alive)
+       if(total_killed < max_monsters)
        {
                SpawnMonsters(NUM_TEAM_1);
                SpawnMonsters(NUM_TEAM_2);
@@ -376,7 +377,7 @@ float TD_CheckWinner()
        if(total_killed < 1)
                return 0; // nothing has died, can't be a tie
        
-       if(TD_ALIVE_TEAMS() > 1)
+       if(TD_ALIVE_TEAMS_OK())
                return 0;
 
        float winner_team = TD_GetWinnerTeam();