From 03ad25908f104e840b2800a57aa4317ed173ebaa Mon Sep 17 00:00:00 2001 From: mand1nga Date: Sat, 20 Aug 2011 22:10:36 -0300 Subject: [PATCH] Clear the entire goal stack if current goal is leading to a dangerous path --- qcsrc/server/bot/havocbot/havocbot.qc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 96f66c927..bc0220b19 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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; } } } -- 2.39.2