From 999e4064ef654c26033a1b2f46241429311b0fac Mon Sep 17 00:00:00 2001 From: terencehill Date: Sun, 2 Dec 2018 17:29:59 +0100 Subject: [PATCH] Add a safety check --- qcsrc/server/bot/default/navigation.qc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/bot/default/navigation.qc b/qcsrc/server/bot/default/navigation.qc index 8fe72ff637..6c5e2769b4 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) -- 2.39.2