]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Clear the entire goal stack if current goal is leading to a dangerous path
authormand1nga <mand1nga@xonotic.org>
Sun, 21 Aug 2011 01:10:36 +0000 (22:10 -0300)
committermand1nga <mand1nga@xonotic.org>
Sun, 21 Aug 2011 01:10:36 +0000 (22:10 -0300)
qcsrc/server/bot/havocbot/havocbot.qc

index 96f66c92707223c0f7a15603389bf78446a05b74..bc0220b19d7e36f2b804c096f76639a6d8257075 100644 (file)
@@ -786,14 +786,9 @@ void havocbot_movetogoal()
                                                if(tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
                                                {
                                                        // Remove dangerous dynamic goals from stack
-                                                       dprint("bot ", self.netname, " removed the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it leads to a dangerous path\n");
-                                                       navigation_poproute();
-                                                       if(self.goalcurrent)
-                                                               gco = (self.goalcurrent.absmin + self.goalcurrent.absmax) * 0.5;
-
-                                                       // try to stop
-                                                       flatdir = '0 0 0';
-                                                       evadeobstacle = normalize(self.velocity) * -1;
+                                                       dprint("bot ", self.netname, " avoided the goal ", self.goalcurrent.classname, " ", etos(self.goalcurrent), " because it led to a dangerous path; goal stack cleared\n");
+                                                       navigation_clearroute();
+                                                       return;
                                                }
                                        }
                                }