From: Mario Date: Wed, 29 Apr 2020 18:45:25 +0000 (+1000) Subject: If the bot has unlimited ammo, always prefer primary attack on the Vaporizer, fixes... X-Git-Tag: xonotic-v0.8.5~1097 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cf1b294c47b02d47f9c0580b6d1a473ce4f12ba5;p=xonotic%2Fxonotic-data.pk3dir.git If the bot has unlimited ammo, always prefer primary attack on the Vaporizer, fixes bots only firing blaster shots with g_use_ammunition 0 and g_instagib_ammo_start 0 --- diff --git a/qcsrc/common/weapons/weapon/vaporizer.qc b/qcsrc/common/weapons/weapon/vaporizer.qc index cfdbe7b7e..e71ed7478 100644 --- a/qcsrc/common/weapons/weapon/vaporizer.qc +++ b/qcsrc/common/weapons/weapon/vaporizer.qc @@ -280,7 +280,7 @@ void W_RocketMinsta_Attack3 (entity actor, .entity weaponentity) METHOD(Vaporizer, wr_aim, void(entity thiswep, entity actor, .entity weaponentity)) { - if(GetResource(actor, thiswep.ammo_type) > 0) + if((actor.items & IT_UNLIMITED_AMMO) || GetResource(actor, thiswep.ammo_type) > 0) PHYS_INPUT_BUTTON_ATCK(actor) = bot_aim(actor, weaponentity, 1000000, 0, 1, false); else PHYS_INPUT_BUTTON_ATCK2(actor) = bot_aim(actor, weaponentity, WEP_CVAR_SEC(vaporizer, speed), 0, WEP_CVAR_SEC(vaporizer, lifetime), false); // WEAPONTODO: replace with proper vaporizer cvars