mirror of
https://github.com/ineedbots/iw3_bot_warfare.git
synced 2025-04-23 02:35:43 +00:00
Reduce more script usage
This commit is contained in:
parent
168a2e621c
commit
4dcea05c2a
@ -1750,7 +1750,7 @@ killWalkOnEvents()
|
|||||||
self endon("disconnect");
|
self endon("disconnect");
|
||||||
self endon("death");
|
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;
|
waittillframeend;
|
||||||
|
|
||||||
@ -1764,12 +1764,11 @@ doWalkScriptNotify()
|
|||||||
{
|
{
|
||||||
self endon("disconnect");
|
self endon("disconnect");
|
||||||
self endon("death");
|
self endon("death");
|
||||||
|
self endon("kill_goal");
|
||||||
|
|
||||||
ret = self waittill_any_return("kill_goal", "goal_internal", "bad_path_internal");
|
if (self waittill_either_return("goal_internal", "bad_path_internal") == "goal_internal")
|
||||||
|
|
||||||
if (ret == "goal_internal")
|
|
||||||
self notify("goal");
|
self notify("goal");
|
||||||
else if (ret == "bad_path_internal")
|
else
|
||||||
self notify("bad_path");
|
self notify("bad_path");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,6 +37,9 @@ connected()
|
|||||||
self thread onSpawned();
|
self thread onSpawned();
|
||||||
|
|
||||||
// cod4x has a force respawn in the exe
|
// cod4x has a force respawn in the exe
|
||||||
|
|
||||||
|
wait 0.1;
|
||||||
|
self.challengeData = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -459,6 +459,27 @@ GetEyePos()
|
|||||||
return self getTagOrigin("tag_eye");
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Waits until either of the nots.
|
Waits until either of the nots.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user