]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Bot AI: if a goal is unreachable, make it not selectable as new goal for a few seconds
authorterencehill <piuntn@gmail.com>
Mon, 20 Nov 2017 15:10:06 +0000 (16:10 +0100)
committerterencehill <piuntn@gmail.com>
Mon, 20 Nov 2017 15:10:06 +0000 (16:10 +0100)
qcsrc/server/bot/api.qh
qcsrc/server/bot/default/havocbot/havocbot.qc

index 39285f77e1152941870bd2ce14c905eb8601ecd1..1e29a25fc30f9d584d17145811ca7fa81d2f1c15 100644 (file)
@@ -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);
index 7e6839c3546b0d68e2adba3f44e8370ecad221b7..4638ef47c1b6cfdfb4f9888ae61635e7a2f782d7 100644 (file)
@@ -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;
                        }
                }