]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Avoid wasting cpu time while a bot is frozen
authorterencehill <piuntn@gmail.com>
Tue, 28 Feb 2017 15:23:46 +0000 (16:23 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 28 Feb 2017 15:23:46 +0000 (16:23 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index 632631c039f2167fb9d55ec7247419cdd2401e75..acb7e86bd8b9d02605eb5c11e0445365c8616445 100644 (file)
@@ -40,13 +40,13 @@ void havocbot_ai(entity this)
                }
                else
                {
-                       if (!this.jumppadcount)
+                       if (!this.jumppadcount && !STAT(FROZEN, this))
                                this.havocbot_role(this); // little too far down the rabbit hole
                }
 
                // TODO: tracewalk() should take care of this job (better path finding under water)
                // if we don't have a goal and we're under water look for a waypoint near the "shore" and push it
-               if(!(IS_DEAD(this)))
+               if(!(IS_DEAD(this) || STAT(FROZEN, this)))
                if(!this.goalcurrent)
                if(this.waterlevel == WATERLEVEL_SWIMMING || (this.aistatus & AI_STATUS_OUT_WATER))
                {
@@ -83,7 +83,7 @@ void havocbot_ai(entity this)
                bot_strategytoken_taken = true;
        }
 
-       if(IS_DEAD(this))
+       if(IS_DEAD(this) || STAT(FROZEN, this))
                return;
 
        havocbot_chooseenemy(this);