From: mand1nga Date: Thu, 18 Aug 2011 19:43:19 +0000 (-0300) Subject: Experimental: path optimization X-Git-Tag: xonotic-v0.5.0~116 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c37c257618f9d6e4181649a5f76685475a9ea521;p=xonotic%2Fxonotic-data.pk3dir.git Experimental: path optimization --- diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index 4f680284e..1386d30d9 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -891,6 +891,16 @@ void navigation_poptouchedgoals() } } + // If for some reason the bot is closer to the next goal, pop the current one + if(self.goalstack01) + if(vlen(self.goalcurrent.origin - self.origin) > vlen(self.goalstack01.origin - self.origin)) + if(checkpvs(self.origin + self.view_ofs, self.goalstack01)) + if(tracewalk(self, self.origin, self.mins, self.maxs, (self.goalstack01.absmin + self.goalstack01.absmax) * 0.5, bot_navigation_movemode)) + { + /// dprint("path optimized, removed a goal from the queue\n"); + navigation_poproute(); + } + // Loose goal touching check when running if(self.aistatus & AI_STATUS_RUNNING) if(self.goalcurrent.classname=="waypoint")