From: mand1nga Date: Sun, 21 Aug 2011 01:10:36 +0000 (-0300) Subject: Clear the entire goal stack if current goal is leading to a dangerous path X-Git-Tag: xonotic-v0.5.0~36^2~7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=03ad25908f104e840b2800a57aa4317ed173ebaa;p=xonotic%2Fxonotic-data.pk3dir.git Clear the entire goal stack if current goal is leading to a dangerous path --- 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; } } }