]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Properly set bot_attack field in a few more situations
authorterencehill <piuntn@gmail.com>
Thu, 20 Aug 2015 23:42:00 +0000 (01:42 +0200)
committerterencehill <piuntn@gmail.com>
Thu, 20 Aug 2015 23:42:00 +0000 (01:42 +0200)
qcsrc/server/cl_client.qc
qcsrc/server/g_damage.qc

index aa02de5b0e8d6d30fe51daa46d205649b3869997..4a7c12bfff95145fabf5cefd2df60db485f8c0c6 100644 (file)
@@ -202,6 +202,7 @@ void PutObserverInServer (void)
        }
 
        self.frags = FRAGS_SPECTATOR;
+       self.bot_attack = false;
 
        MUTATOR_CALLHOOK(MakePlayerObserver);
 
index a20d35220ae08c703c8afa7f317ee0b058d9f921..9f2ead80ffa19b65e4f70bee2a08e78e0f2a02e3 100644 (file)
@@ -566,6 +566,7 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
        targ.revive_progress = ((frozen_type == 3) ? 1 : 0);
        targ.health = ((frozen_type == 3) ? targ_maxhealth : 1);
        targ.revive_speed = freeze_time;
+       self.bot_attack = false;
 
        entity ice, head;
        ice = spawn();
@@ -601,6 +602,9 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
+       if(!targ.frozen)
+               return;
+
        if(targ.frozen && targ.frozen != 3) // only reset health if target was frozen
                targ.health = ((IS_PLAYER(targ)) ? start_health : targ.max_health);
 
@@ -608,6 +612,7 @@ void Unfreeze (entity targ)
        targ.frozen = 0;
        targ.revive_progress = 0;
        targ.revival_time = time;
+       self.bot_attack = true;
 
        WaypointSprite_Kill(targ.waypointsprite_attached);