mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-22 05:55:42 +00:00
fast continue jav
This commit is contained in:
parent
4905d51c9d
commit
0b13d26eb4
@ -1094,6 +1094,22 @@ nearAnyOfWaypoints(dist, waypoints)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getNearestWaypointOfWaypoints(waypoints)
|
||||||
|
{
|
||||||
|
answer = undefined;
|
||||||
|
for (i = 0; i < waypoints.size; i++)
|
||||||
|
{
|
||||||
|
waypoint = waypoints[i];
|
||||||
|
|
||||||
|
if (isDefined(answer) && closer(self.origin, answer.origin, waypoint.origin))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
answer = waypoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
|
||||||
bot_escort_obj(obj, carrier)
|
bot_escort_obj(obj, carrier)
|
||||||
{
|
{
|
||||||
self endon( "death" );
|
self endon( "death" );
|
||||||
@ -1900,7 +1916,12 @@ bot_jav_loc_think()
|
|||||||
self endon("death");
|
self endon("death");
|
||||||
level endon("game_ended");
|
level endon("game_ended");
|
||||||
|
|
||||||
|
doFastContinue = false;
|
||||||
for (;;)
|
for (;;)
|
||||||
|
{
|
||||||
|
if (doFastContinue)
|
||||||
|
doFastContinue = false;
|
||||||
|
else
|
||||||
{
|
{
|
||||||
wait randomintRange(2, 4);
|
wait randomintRange(2, 4);
|
||||||
|
|
||||||
@ -1910,6 +1931,7 @@ bot_jav_loc_think()
|
|||||||
|
|
||||||
if (randomInt(100) > chance)
|
if (randomInt(100) > chance)
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (!self GetAmmoCount("javelin_mp"))
|
if (!self GetAmmoCount("javelin_mp"))
|
||||||
continue;
|
continue;
|
||||||
@ -1942,6 +1964,10 @@ bot_jav_loc_think()
|
|||||||
if (self isEMPed())
|
if (self isEMPed())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
loc = undefined;
|
||||||
|
|
||||||
|
if (!self nearAnyOfWaypoints(128, level.waypointsJav))
|
||||||
|
{
|
||||||
javWps = [];
|
javWps = [];
|
||||||
for (i = 0; i < level.waypointsJav.size; i++)
|
for (i = 0; i < level.waypointsJav.size; i++)
|
||||||
{
|
{
|
||||||
@ -1952,7 +1978,6 @@ bot_jav_loc_think()
|
|||||||
}
|
}
|
||||||
javWp = random(javWps);
|
javWp = random(javWps);
|
||||||
|
|
||||||
loc = undefined;
|
|
||||||
if (!isDefined(javWp) || self HasScriptGoal() || self.bot_lock_goal)
|
if (!isDefined(javWp) || self HasScriptGoal() || self.bot_lock_goal)
|
||||||
{
|
{
|
||||||
traceForward = self maps\mp\_javelin::EyeTraceForward();
|
traceForward = self maps\mp\_javelin::EyeTraceForward();
|
||||||
@ -1971,8 +1996,6 @@ bot_jav_loc_think()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
loc = javWp.jav_point;
|
|
||||||
|
|
||||||
self SetScriptGoal(javWp.origin, 16);
|
self SetScriptGoal(javWp.origin, 16);
|
||||||
|
|
||||||
ret = self waittill_any_return("new_goal", "goal", "bad_path");
|
ret = self waittill_any_return("new_goal", "goal", "bad_path");
|
||||||
@ -1982,6 +2005,15 @@ bot_jav_loc_think()
|
|||||||
|
|
||||||
if (ret != "goal")
|
if (ret != "goal")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
doFastContinue = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
javWp = self getNearestWaypointOfWaypoints(level.waypointsJav);
|
||||||
|
loc = javWp.jav_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
self SetBotJavelinLocation(loc);
|
self SetBotJavelinLocation(loc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user