mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-19 21:12:52 +00:00
Fixed climb
This commit is contained in:
parent
c09b792a05
commit
161e40a6cd
1
.gitignore
vendored
1
.gitignore
vendored
@ -17,6 +17,7 @@
|
|||||||
!/main/server.cfg
|
!/main/server.cfg
|
||||||
|
|
||||||
*.log
|
*.log
|
||||||
|
*.stat
|
||||||
logs/
|
logs/
|
||||||
demos/
|
demos/
|
||||||
missingasset.csv
|
missingasset.csv
|
@ -380,6 +380,8 @@ moveHack()
|
|||||||
self endon("disconnect");
|
self endon("disconnect");
|
||||||
self endon("death");
|
self endon("death");
|
||||||
|
|
||||||
|
self SetOrigin((0,0,-500));
|
||||||
|
|
||||||
self.bot.last_pos = self.origin;
|
self.bot.last_pos = self.origin;
|
||||||
self.bot.moveTo = self.origin;
|
self.bot.moveTo = self.origin;
|
||||||
|
|
||||||
@ -405,10 +407,12 @@ moveHack()
|
|||||||
inLastStand = isDefined(self.lastStand);
|
inLastStand = isDefined(self.lastStand);
|
||||||
usingRemote = self isUsingRemote();
|
usingRemote = self isUsingRemote();
|
||||||
|
|
||||||
|
if (!self.bot.climbing)
|
||||||
|
{
|
||||||
// a number between 0 and 1, 1 being totally flat, same level. 0 being totally above or below. about 0.7 is a 45 degree angle
|
// a number between 0 and 1, 1 being totally flat, same level. 0 being totally above or below. about 0.7 is a 45 degree angle
|
||||||
verticleDegree = getConeDot(self.bot.moveTo + (1, 1, 0), self.origin + (-1, -1, 0), VectorToAngles((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2]) - self.origin));
|
verticleDegree = getConeDot(self.bot.moveTo + (1, 1, 0), self.origin + (-1, -1, 0), VectorToAngles((self.bot.moveTo[0], self.bot.moveTo[1], self.origin[2]) - self.origin));
|
||||||
self.bot.climbing = (self.bot.next_wp != -1 && level.waypoints[self.bot.next_wp].type == "climb") ||
|
self.bot.climbing = (abs(self.bot.moveTo[2] - self.origin[2]) > 50 && verticleDegree < 0.64);
|
||||||
(abs(self.bot.moveTo[2] - self.origin[2]) > 50 && verticleDegree < 0.64);
|
}
|
||||||
|
|
||||||
if (inLastStand || usingRemote)
|
if (inLastStand || usingRemote)
|
||||||
self.bot.climbing = false;
|
self.bot.climbing = false;
|
||||||
@ -546,12 +550,6 @@ adsHack()
|
|||||||
if (!isAlive(self))
|
if (!isAlive(self))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (self isUsingRemote())
|
|
||||||
{
|
|
||||||
self ResetSpreadOverride();
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
shouldAds = self.bot.ads_pressed;
|
shouldAds = self.bot.ads_pressed;
|
||||||
|
|
||||||
if (level.gameEnded)
|
if (level.gameEnded)
|
||||||
@ -584,6 +582,9 @@ adsHack()
|
|||||||
if (self.bot.ads_tightness > self.bot.ads_lowest)
|
if (self.bot.ads_tightness > self.bot.ads_lowest)
|
||||||
self.bot.ads_tightness = self.bot.ads_lowest;
|
self.bot.ads_tightness = self.bot.ads_lowest;
|
||||||
|
|
||||||
|
if (self.bot.ads_tightness >= self.bot.ads_lowest)
|
||||||
|
self ResetSpreadOverride();
|
||||||
|
else
|
||||||
self setSpreadOverride(self.bot.ads_tightness);
|
self setSpreadOverride(self.bot.ads_tightness);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -798,6 +799,7 @@ stance()
|
|||||||
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;
|
||||||
|
self.bot.climbing = (toStance == "climb");
|
||||||
if(toStance == "climb")
|
if(toStance == "climb")
|
||||||
toStance = "stand";
|
toStance = "stand";
|
||||||
|
|
||||||
@ -1559,7 +1561,7 @@ walk()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
hasTarget = isDefined(self.bot.target) && isDefined(self.bot.target.entity);
|
hasTarget = (isDefined(self.bot.target) && isDefined(self.bot.target.entity) && !self.bot.climbing);
|
||||||
if(hasTarget)
|
if(hasTarget)
|
||||||
{
|
{
|
||||||
curweap = self getCurrentWeapon();
|
curweap = self getCurrentWeapon();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user