From: terencehill Date: Sun, 2 Dec 2018 16:29:59 +0000 (+0100) Subject: Add a safety check X-Git-Tag: xonotic-v0.8.5~1705^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=999e4064ef654c26033a1b2f46241429311b0fac;p=xonotic%2Fxonotic-data.pk3dir.git Add a safety check --- diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 8fe72ff63..6c5e2769b 100644 --- a/qcsrc/server/bot/default/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1808,15 +1808,17 @@ void navigation_goalrating_end(entity this) LOG_DEBUG("best goal ", this.goalcurrent.classname); // If the bot got stuck then try to reach the farthest waypoint - if (!this.goalentity && autocvar_bot_wander_enable) + if (!this.goalentity) { - if (!(this.aistatus & AI_STATUS_STUCK)) + if (autocvar_bot_wander_enable && !(this.aistatus & AI_STATUS_STUCK)) { LOG_DEBUG(this.netname, " cannot walk to any goal"); this.aistatus |= AI_STATUS_STUCK; } + this.goalentity_shouldbefrozen = false; } - this.goalentity_shouldbefrozen = boolean(STAT(FROZEN, this.goalentity)); + else + this.goalentity_shouldbefrozen = boolean(STAT(FROZEN, this.goalentity)); } void botframe_updatedangerousobjects(float maxupdate)