smol changes

This commit is contained in:
INeedBots 2020-11-25 13:27:04 -06:00
parent 16d4f4795d
commit 91997120e8
2 changed files with 14 additions and 5 deletions

View File

@ -109,6 +109,7 @@ resetBotVars()
self.bot.moveTo = self.origin; self.bot.moveTo = self.origin;
self.bot.stop_move = false; self.bot.stop_move = false;
self.bot.greedy_path = false; self.bot.greedy_path = false;
self.bot.climbing = false;
self.bot.isfrozen = false; self.bot.isfrozen = false;
self.bot.sprintendtime = -1; self.bot.sprintendtime = -1;
@ -501,15 +502,23 @@ stance()
{ {
self waittill_either("finished_static_waypoints", "new_static_waypoint"); self waittill_either("finished_static_waypoints", "new_static_waypoint");
self.bot.climbing = false;
if(self.bot.isfrozen || self IsUsingRemote()) if(self.bot.isfrozen || self IsUsingRemote())
continue; continue;
toStance = "stand"; toStance = "stand";
if(self.bot.next_wp != -1) if(self.bot.next_wp != -1)
toStance = level.waypoints[self.bot.next_wp].type; toStance = level.waypoints[self.bot.next_wp].type;
if (!isDefined(toStance))
toStance = "crouch";
if(toStance == "climb") if(toStance == "climb")
{
self.bot.climbing = true;
toStance = "stand"; toStance = "stand";
}
if(toStance != "stand" && toStance != "crouch" && toStance != "prone") if(toStance != "stand" && toStance != "crouch" && toStance != "prone")
toStance = "crouch"; toStance = "crouch";
@ -1255,7 +1264,8 @@ aim()
else if (!usingRemote) else if (!usingRemote)
{ {
lookat = undefined; lookat = undefined;
if(self.bot.second_next_wp != -1 && !self.bot.issprinting)
if(self.bot.second_next_wp != -1 && !self.bot.issprinting && !self.bot.climbing)
lookat = level.waypoints[self.bot.second_next_wp].origin; lookat = level.waypoints[self.bot.second_next_wp].origin;
else if(isDefined(self.bot.towards_goal)) else if(isDefined(self.bot.towards_goal))
lookat = self.bot.towards_goal; lookat = self.bot.towards_goal;
@ -1704,6 +1714,8 @@ movetowards(goal)
randomDir = self getRandomLargestStafe(stucks); randomDir = self getRandomLargestStafe(stucks);
self knife(); // knife glass
wait 0.25;
self botMoveTo(randomDir); self botMoveTo(randomDir);
wait stucks; wait stucks;
} }

View File

@ -1501,7 +1501,7 @@ getNearestWaypointOfWaypoints(waypoints)
waypoint = waypoints[i]; waypoint = waypoints[i];
thisDist = DistanceSquared(self.origin, waypoint.origin); thisDist = DistanceSquared(self.origin, waypoint.origin);
if (thisDist > closestDist) if (isDefined(answer) && thisDist > closestDist)
continue; continue;
answer = waypoint; answer = waypoint;
@ -2270,9 +2270,6 @@ bot_use_tube_think()
if (self IsBotFragging() || self IsBotSmoking()) if (self IsBotFragging() || self IsBotSmoking())
continue; continue;
if(self IsBotReloading() || self IsBotKnifing())
continue;
if(self isDefusing() || self isPlanting()) if(self isDefusing() || self isPlanting())
continue; continue;