From 665da56501a1adbdbc12ff060ed442f80978af4e Mon Sep 17 00:00:00 2001 From: mand1nga Date: Thu, 21 Apr 2011 21:14:48 -0300 Subject: [PATCH] Better variable names --- qcsrc/server/bot/bot.qc | 4 +-- qcsrc/server/bot/navigation.qc | 46 +++++++++++++++++----------------- qcsrc/server/bot/navigation.qh | 10 ++++---- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index d2ee461da..8be71a3cf 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -376,8 +376,8 @@ void bot_clientdisconnect() self.playermodel_freeme = string_null; self.playerskin_freeme = string_null; remove(self.bot_cmd_current); - if(navigation_wander_owner==self) - navigation_wander_owner = world; + if(bot_waypoint_queue_owner==self) + bot_waypoint_queue_owner = world; } void bot_clientconnect() diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/navigation.qc index c5e2180ca..4c4044f10 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/navigation.qc @@ -966,37 +966,37 @@ void navigation_unstuck() if not(autocvar_bot_wander_enable) return; - if not(navigation_wander_owner) + if not(bot_waypoint_queue_owner) { dprint(self.netname, " taking over the waypoints queue\n"); - navigation_wander_owner = self; - navigation_wander_bestgoal = world; - navigation_wander_bestgoalrating = 0; + bot_waypoint_queue_owner = self; + bot_waypoint_queue_bestgoal = world; + bot_waypoint_queue_bestgoalrating = 0; } - if(navigation_wander_owner!=self) + if(bot_waypoint_queue_owner!=self) return; - if (navigation_wander_goal) + if (bot_waypoint_queue_goal) { // evaluate the next goal on the queue - float d = vlen(self.origin - navigation_wander_goal.origin); - // dprint(self.netname, " evaluating ", navigation_wander_goal.classname, " with distance ", ftos(d), "\n"); - if(tracewalk(navigation_wander_goal, self.origin, PL_MIN, PL_MAX, navigation_wander_goal.origin, bot_navigation_movemode)) + float d = vlen(self.origin - bot_waypoint_queue_goal.origin); + // dprint(self.netname, " evaluating ", bot_waypoint_queue_goal.classname, " with distance ", ftos(d), "\n"); + if(tracewalk(bot_waypoint_queue_goal, self.origin, PL_MIN, PL_MAX, bot_waypoint_queue_goal.origin, bot_navigation_movemode)) { - if( d > navigation_wander_bestgoalrating) + if( d > bot_waypoint_queue_bestgoalrating) { - navigation_wander_bestgoalrating = d; - navigation_wander_bestgoal = navigation_wander_goal; + bot_waypoint_queue_bestgoalrating = d; + bot_waypoint_queue_bestgoal = bot_waypoint_queue_goal; } } - navigation_wander_goal = navigation_wander_goal.navigation_wander_nextgoal; + bot_waypoint_queue_goal = bot_waypoint_queue_goal.bot_waypoint_queue_nextgoal; - if not(navigation_wander_goal) + if not(bot_waypoint_queue_goal) { - if (navigation_wander_bestgoal) + if (bot_waypoint_queue_bestgoal) { - navigation_routetogoal(navigation_wander_bestgoal, self.origin); + navigation_routetogoal(bot_waypoint_queue_bestgoal, self.origin); self.bot_strategytime = time + autocvar_bot_ai_strategyinterval; self.aistatus &~= AI_STATUS_STUCK; } @@ -1005,7 +1005,7 @@ void navigation_unstuck() dprint(self.netname, " got BADLY stuck, giving up.\n"); } - navigation_wander_owner = world; + bot_waypoint_queue_owner = world; } } else @@ -1027,14 +1027,14 @@ void navigation_unstuck() if (first==world) { first = head; - navigation_wander_goal = head; + bot_waypoint_queue_goal = head; } else { - prev = navigation_wander_goal; - navigation_wander_goal = head; - prev.navigation_wander_nextgoal = head; - navigation_wander_goal.navigation_wander_nextgoal = world; + 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; } } @@ -1042,7 +1042,7 @@ void navigation_unstuck() } if (first) - navigation_wander_goal = first; + bot_waypoint_queue_goal = first; else { dprint(self.netname, " got BADLY stuck, giving up.\n"); diff --git a/qcsrc/server/bot/navigation.qh b/qcsrc/server/bot/navigation.qh index 6355ef700..0a9bf1401 100644 --- a/qcsrc/server/bot/navigation.qh +++ b/qcsrc/server/bot/navigation.qh @@ -35,11 +35,11 @@ float DEBUG_NODE_WARNING = 2; float DEBUG_NODE_FAIL = 3; vector debuglastnode; -entity navigation_wander_owner; // Owner of the temporary list of goals -entity navigation_wander_goal; // Head of the temporary list of goals -.entity navigation_wander_nextgoal; -entity navigation_wander_bestgoal; -float navigation_wander_bestgoalrating; +entity bot_waypoint_queue_owner; // Owner of the temporary list of goals +entity bot_waypoint_queue_goal; // Head of the temporary list of goals +.entity bot_waypoint_queue_nextgoal; +entity bot_waypoint_queue_bestgoal; +float bot_waypoint_queue_bestgoalrating; /* * Functions -- 2.39.2