mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-19 21:12:52 +00:00
Reduce var usage
This commit is contained in:
parent
a18aa4c446
commit
f109ab8fbb
@ -1930,7 +1930,7 @@ killWalkOnEvents()
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
|
||||
ret = self waittill_any_return("flash_rumble_loop", "new_enemy", "new_goal_internal", "goal_internal", "bad_path_internal");
|
||||
self waittill_any("flash_rumble_loop", "new_enemy", "new_goal_internal", "goal_internal", "bad_path_internal");
|
||||
|
||||
waittillframeend;
|
||||
|
||||
@ -1944,12 +1944,11 @@ doWalkScriptNotify()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
|
||||
ret = self waittill_any_return("goal_internal", "kill_goal", "bad_path_internal");
|
||||
|
||||
if (ret == "goal_internal")
|
||||
self endon("kill_goal");
|
||||
|
||||
if (self waittill_either_return("goal_internal", "bad_path_internal") == "goal_internal")
|
||||
self notify("goal");
|
||||
else if (ret == "bad_path_internal")
|
||||
else
|
||||
self notify("bad_path");
|
||||
}
|
||||
|
||||
|
@ -51,6 +51,9 @@ connected()
|
||||
self thread onGiveLoadout();
|
||||
|
||||
self thread onKillcam();
|
||||
|
||||
wait 0.1;
|
||||
self.challengeData = [];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -447,6 +447,27 @@ getValidTube()
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/*
|
||||
helper
|
||||
*/
|
||||
waittill_either_return_(str1, str2)
|
||||
{
|
||||
self endon(str1);
|
||||
self waittill(str2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns which string gets notified first
|
||||
*/
|
||||
waittill_either_return(str1, str2)
|
||||
{
|
||||
if (!isDefined(self waittill_either_return_(str1, str2)))
|
||||
return str1;
|
||||
|
||||
return str2;
|
||||
}
|
||||
|
||||
/*
|
||||
Returns a random grenade in the bot's inventory.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user