From: terencehill Date: Mon, 20 Nov 2017 15:10:06 +0000 (+0100) Subject: Bot AI: if a goal is unreachable, make it not selectable as new goal for a few seconds X-Git-Tag: xonotic-v0.8.5~2378^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=964507292fa408dabac78eceb337c92c93547a7e;p=xonotic%2Fxonotic-data.pk3dir.git Bot AI: if a goal is unreachable, make it not selectable as new goal for a few seconds --- diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh index 39285f77e..1e29a25fc 100644 --- a/qcsrc/server/bot/api.qh +++ b/qcsrc/server/bot/api.qh @@ -77,6 +77,9 @@ vector havocbot_middlepoint; float havocbot_middlepoint_radius; vector havocbot_symmetryaxis_equation; +.float ignoregoaltime; +.entity ignoregoal; + .entity bot_basewaypoint; .bool navigation_dynamicgoal; void navigation_dynamicgoal_init(entity this, bool initially_static); diff --git a/qcsrc/server/bot/default/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc index 7e6839c35..4638ef47c 100644 --- a/qcsrc/server/bot/default/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -988,6 +988,8 @@ void havocbot_movetogoal(entity this) { navigation_clearroute(this); navigation_goalrating_timeout_force(this); + this.ignoregoal = this.goalcurrent; + this.ignoregoaltime = time + autocvar_bot_ai_ignoregoal_timeout; } }