mirror of
https://github.com/ineedbots/iw5_bot_warfare.git
synced 2025-04-26 07:34:50 +00:00
Improved usage
This commit is contained in:
parent
a289739feb
commit
95a93246fc
@ -1840,7 +1840,7 @@ checkTheBots(){if(!randomint(3)){for(i=0;i<level.players.size;i++){player=level.
|
||||
killWalkCauseNoWaypoints()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
self endon("spawned_player");
|
||||
self endon("kill_goal");
|
||||
|
||||
wait 2;
|
||||
@ -2067,7 +2067,7 @@ killWalkOnEvents()
|
||||
{
|
||||
self endon("kill_goal");
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
self endon("spawned_player");
|
||||
|
||||
self waittill_any("flash_rumble_loop", "new_enemy", "new_goal_internal", "goal_internal", "bad_path_internal");
|
||||
|
||||
@ -2082,13 +2082,12 @@ killWalkOnEvents()
|
||||
doWalkScriptNotify()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
self endon("spawned_player");
|
||||
self endon("kill_goal");
|
||||
|
||||
ret = self waittill_any_return("goal_internal", "kill_goal", "bad_path_internal");
|
||||
|
||||
if (ret == "goal_internal")
|
||||
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");
|
||||
}
|
||||
|
||||
|
@ -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