]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove path to unreachable goals that lead to falling off the map (example case:...
authorterencehill <piuntn@gmail.com>
Sun, 25 Dec 2016 09:06:49 +0000 (10:06 +0100)
committerterencehill <piuntn@gmail.com>
Sun, 25 Dec 2016 09:06:49 +0000 (10:06 +0100)
qcsrc/server/bot/default/havocbot/havocbot.qc

index b3c0f58d9168e813833c94aa7958bdf0e439f61f..80dc706e95643311ccc5bc8da771b86fd1c9fbca 100644 (file)
@@ -778,7 +778,17 @@ void havocbot_movetogoal(entity this)
                                        {
                                                tracebox(dst_ahead, this.mins, this.maxs, dst_down, true, this);
                                                if (tracebox_hits_trigger_hurt(dst_ahead, this.mins, this.maxs, trace_endpos))
-                                                       evadelava = normalize(this.velocity) * -1;
+                                               {
+                                                       if (gco.z > this.origin.z + jumpstepheightvec.z)
+                                                       { 
+                                                               // the goal is probably on an upper platform, assume bot can't get there
+                                                               LOG_TRACE("bot ", this.netname, " avoided the goal ", this.goalcurrent.classname, " ", etos(this.goalcurrent), " because it led to a dangerous path; goal stack cleared");
+                                                               navigation_clearroute(this);
+                                                               this.bot_strategytime = 0;
+                                                       }
+                                                       else
+                                                               evadelava = normalize(this.velocity) * -1;
+                                               }
                                        }
                                }
                        }