update too date with mw2

This commit is contained in:
INeedBots 2020-09-25 03:18:52 -06:00
parent 28aaface14
commit c220c36cf8

View File

@ -1051,6 +1051,9 @@ isInRange(dist, curweap)
return true; return true;
} }
/*
Will kill the walk threads and do it again after a time
*/
killWalkCauseNoWaypoints() killWalkCauseNoWaypoints()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1269,6 +1272,9 @@ killWalkOnEvents()
self notify("kill_goal"); self notify("kill_goal");
} }
/*
Does the notify for goal completion for outside scripts
*/
doWalkScriptNotify() doWalkScriptNotify()
{ {
self endon("disconnect"); self endon("disconnect");
@ -1298,11 +1304,13 @@ doWalk(goal, dist, isScriptGoal)
self thread watchOnGoal(goal, distsq); self thread watchOnGoal(goal, distsq);
current = self initAStar(goal); current = self initAStar(goal);
// if a waypoint is closer than the goal
//if (current >= 0 && DistanceSquared(self.origin, level.waypoints[self.bot.astar[current]].origin) < DistanceSquared(self.origin, goal)) //if (current >= 0 && DistanceSquared(self.origin, level.waypoints[self.bot.astar[current]].origin) < DistanceSquared(self.origin, goal))
//{ //{
while(current >= 0) while(current >= 0)
{ {
for (;;) // skip down the line of waypoints and go to the waypoint we have a direct path too
/*for (;;)
{ {
if (current <= 0) if (current <= 0)
break; break;
@ -1315,7 +1323,7 @@ doWalk(goal, dist, isScriptGoal)
break; break;
current = self removeAStar(); current = self removeAStar();
} }*/
self.bot.next_wp = self.bot.astar[current]; self.bot.next_wp = self.bot.astar[current];
self.bot.second_next_wp = -1; self.bot.second_next_wp = -1;