From: terencehill Date: Tue, 28 Feb 2017 15:23:46 +0000 (+0100) Subject: Avoid wasting cpu time while a bot is frozen X-Git-Tag: xonotic-v0.8.2~163 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bbf1c251b52dad30515cf3bfcdbde0017eec6327;p=xonotic%2Fxonotic-data.pk3dir.git Avoid wasting cpu time while a bot is frozen --- diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 632631c03..acb7e86bd 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -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);