]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Also check if monster teammates need help
authorMario <mario.mario@y7mail.com>
Thu, 18 Apr 2013 06:50:20 +0000 (16:50 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 18 Apr 2013 06:50:20 +0000 (16:50 +1000)
qcsrc/server/monsters/monster/shalrath.qc

index f0690025732cd22743a03a9c192b60785c07915e..4914a4bff383697a6f1d463c65a826085541c336 100644 (file)
@@ -45,6 +45,19 @@ void shalrath_think ()
        
        FOR_EACH_PLAYER(head)
        {
+               if not(IsDifferentTeam(head, self))
+               if(head.health > 0)
+               if(vlen(head.origin - self.origin) < autocvar_g_monster_shalrath_heal_range * self.scale)
+               if((!g_minstagib && head.health < autocvar_g_balance_health_regenstable) || (g_minstagib && head.ammo_cells < start_ammo_cells))
+               {
+                       friend_needshelp = TRUE;
+                       break; // found 1 player near us who is low on health
+               }
+       }
+       FOR_EACH_MONSTER(head)
+       {
+               if not(IsDifferentTeam(head, self))
+               if(head.health > 0)
                if(vlen(head.origin - self.origin) < autocvar_g_monster_shalrath_heal_range * self.scale)
                if((!g_minstagib && head.health < autocvar_g_balance_health_regenstable) || (g_minstagib && head.ammo_cells < start_ammo_cells))
                {
@@ -59,9 +72,6 @@ void shalrath_think ()
        if(self.weaponentity)
        if(time >= self.weaponentity.ltime)
                shalrath_shield_die();
-       
-       if(self.delay != -1)
-               self.nextthink = self.delay;
                
        if(self.health < autocvar_g_monster_shalrath_heal_minhealth || friend_needshelp)
        if(time >= self.attack_finished_single)