mirror of
https://github.com/ineedbots/t4_bot_warfare.git
synced 2025-04-22 07:55:43 +00:00
Reduce var usage
This commit is contained in:
parent
831a63032b
commit
7d8ed25cdc
@ -1790,7 +1790,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;
|
||||
|
||||
@ -1804,12 +1804,11 @@ doWalkScriptNotify()
|
||||
{
|
||||
self endon("disconnect");
|
||||
self endon("death");
|
||||
self endon("kill_goal");
|
||||
|
||||
ret = self waittill_any_return("kill_goal", "goal_internal", "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");
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,9 @@ connected()
|
||||
self thread onBotSpawned();
|
||||
self thread onSpawned();
|
||||
self thread onDeath();
|
||||
|
||||
wait 0.1;
|
||||
self.challengeData = [];
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -496,6 +496,27 @@ GetEyePos()
|
||||
return self getTagOrigin("tag_eye");
|
||||
}
|
||||
|
||||
/*
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
Taken from iw4 script
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user