mirror of
https://github.com/ineedbots/iw4_bot_warfare.git
synced 2025-04-23 14:25:43 +00:00
switch changes
This commit is contained in:
parent
f95391b906
commit
154332f014
@ -149,6 +149,7 @@ resetBotVars()
|
|||||||
self.bot.rand = randomInt(100);
|
self.bot.rand = randomInt(100);
|
||||||
|
|
||||||
self.bot.isswitching = false;
|
self.bot.isswitching = false;
|
||||||
|
self.bot.switch_to_after_none = undefined;
|
||||||
|
|
||||||
self.bot.stance = "stand";
|
self.bot.stance = "stand";
|
||||||
|
|
||||||
@ -986,8 +987,7 @@ onWeaponChange()
|
|||||||
switch (newWeapon)
|
switch (newWeapon)
|
||||||
{
|
{
|
||||||
case "none":
|
case "none":
|
||||||
if(isDefined(self.lastDroppableWeapon) && self.lastDroppableWeapon != "none" && !self.disabledWeapon)
|
self thread doNoneSwitch();
|
||||||
self setSpawnWeapon(self.lastDroppableWeapon);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
self thread doSwitch(newWeapon);
|
self thread doSwitch(newWeapon);
|
||||||
@ -996,17 +996,38 @@ onWeaponChange()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doNoneSwitch()
|
||||||
|
{
|
||||||
|
self endon("disconnect");
|
||||||
|
self endon("death");
|
||||||
|
self endon("weapon_change");
|
||||||
|
|
||||||
|
self.bot.isswitching = false;
|
||||||
|
|
||||||
|
while (self.disabledWeapon)
|
||||||
|
wait 0.05;
|
||||||
|
|
||||||
|
weap = self.lastDroppableWeapon;
|
||||||
|
if (isDefined(self.bot.switch_to_after_none))
|
||||||
|
{
|
||||||
|
weap = self.bot.switch_to_after_none;
|
||||||
|
self.bot.switch_to_after_none = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
self setSpawnWeapon(weap);
|
||||||
|
}
|
||||||
|
|
||||||
doSwitch(newWeapon)
|
doSwitch(newWeapon)
|
||||||
{
|
{
|
||||||
self endon("disconnect");
|
self endon("disconnect");
|
||||||
self endon("death");
|
self endon("death");
|
||||||
self notify("bot_weapon_change");
|
self endon("weapon_change");
|
||||||
self endon("bot_weapon_change");
|
|
||||||
|
|
||||||
if (self.bot.climbing)
|
if (self.bot.climbing)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (isDefined(self.lastDroppableWeapon) && self.lastDroppableWeapon != newWeapon)
|
waittillframeend;
|
||||||
|
if (self.lastDroppableWeapon != newWeapon)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!self inLastStand() && !self.bot.isfraggingafter && !self.bot.knifingafter)
|
if (!self inLastStand() && !self.bot.isfraggingafter && !self.bot.knifingafter)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user