From: mand1nga Date: Fri, 22 Apr 2011 00:45:50 +0000 (-0300) Subject: Cleaner handling of the queue X-Git-Tag: xonotic-v0.5.0~264^2~28^2~1^2~1 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=0d17ea4a6fc382131b4f06e971f8abe9d2ae97a2;p=xonotic%2Fxonotic-data.pk3dir.git Cleaner handling of the queue --- diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 4c4044f10..8f72014a2 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -1016,7 +1016,9 @@ void navigation_unstuck() // build a new queue dprint(self.netname, " building a new wayoints queue\n"); - entity first, head, prev; + entity head, first; + + first = world; head = findradius(self.origin, 1000); while(head) @@ -1024,18 +1026,13 @@ void navigation_unstuck() if(head.classname=="waypoint") if(!(head.wpflags & WAYPOINTFLAG_GENERATED)) { - if (first==world) - { - first = head; - bot_waypoint_queue_goal = head; - } + if(bot_waypoint_queue_goal) + bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = head; else - { - prev = bot_waypoint_queue_goal; - bot_waypoint_queue_goal = head; - prev.bot_waypoint_queue_nextgoal = head; - bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = world; - } + first = head; + + bot_waypoint_queue_goal = head; + bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal = world; } head = head.chain;