This commit is contained in:
Your Name 2020-09-17 13:20:22 -06:00
parent 9426b7cb73
commit 7185bf16b6
3 changed files with 31 additions and 8 deletions

View File

@ -565,7 +565,7 @@ emptyClipShoot()
cur = self GetCurrentWeapon(); cur = self GetCurrentWeapon();
if (IsWeaponClipOnly(cur) || !self GetWeaponAmmoStock(cur) || self IsUsingRemote()) if (cur == "none" || IsWeaponClipOnly(cur) || !self GetWeaponAmmoStock(cur) || self IsUsingRemote())
continue; continue;
self thread pressFire(); self thread pressFire();
@ -1014,7 +1014,7 @@ doNoneSwitch()
self.bot.switch_to_after_none = undefined; self.bot.switch_to_after_none = undefined;
} }
self setSpawnWeapon(weap); self SetSpawnWeapon(weap);
} }
doSwitch(newWeapon) doSwitch(newWeapon)

View File

@ -117,15 +117,12 @@ getValidGrenade()
return random(possibles); return random(possibles);
} }
botChangeWeapon(weapon) botChangeWeapon(weapon)// intrestingly, this allows the bots to use pullout and pulldown anims and etc, but bugs out when the bot is frozen while midburst of a firerate limited weapon (m16, only shot one shot, or two shots, even though its a 3 round burst) (never switches until unfrozen)
{ {
self endon("death"); self endon("death");
self endon("disconnect"); self endon("disconnect");
if (level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.isfrozen || self IsUsingRemote()) if (level.gameEnded || !gameFlag( "prematch_done" ) || self.bot.isfrozen)
return;
if(self isDefusing() || self isPlanting())
return; return;
if (self.bot.knifing || self.bot.isfraggingafter) if (self.bot.knifing || self.bot.isfraggingafter)
@ -133,6 +130,33 @@ botChangeWeapon(weapon)
if (self.disabledWeapon) if (self.disabledWeapon)
return; return;
if (self InLastStand() && !self InFinalStand())
return;
self.bot.switch_to_after_none = weapon;
self.bot.switching = true;
ret = undefined;
if (self GetCurrentWeapon() == "none")
{
self notify("weapon_change");
ret = self waittill_any_timeout(5, "weapon_change");
}
else
{
self _DisableWeapon();
self waittill_any_timeout(5, "weapon_change");
self _EnableWeapon();
ret = self waittill_any_timeout(5, "weapon_change");
}
if (ret == "timeout")
return false;
waittillframeend;
self notify("bot_weapon_change", self GetCurrentWeapon());
return true;
} }
throwBotGrenade(gname, gtime) throwBotGrenade(gname, gtime)

View File

@ -1,7 +1,6 @@
_script: _script:
bomb gamemodes, bomb gamemodes,
unreleased gamemodes unreleased gamemodes
switch weapon with disable weapon
_other: _other:
dvars, loadout, behaviour, menu dvars, loadout, behaviour, menu