From: drjaska Date: Thu, 29 Dec 2022 17:53:50 +0000 (+0200) Subject: simplify electro clip reload X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c649bee098d90abdbd1b23a77c846d2b3708092e;p=xonotic%2Fxonotic-data.pk3dir.git simplify electro clip reload --- diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 97929c7dd..d7ff581c6 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -530,15 +530,9 @@ METHOD(Electro, wr_aim, void(entity thiswep, entity actor, .entity weaponentity) } METHOD(Electro, wr_think, void(entity thiswep, entity actor, .entity weaponentity, int fire)) { - if(autocvar_g_balance_electro_reload_ammo) // forced reload // WEAPONTODO + if(autocvar_g_balance_electro_reload_ammo) // forced reload { - float ammo_amount = 0; - if(actor.(weaponentity).clip_load >= WEP_CVAR_PRI(electro, ammo)) - ammo_amount = 1; - if(actor.(weaponentity).clip_load >= WEP_CVAR_SEC(electro, ammo)) - ammo_amount += 1; - - if(!ammo_amount) + if(actor.(weaponentity).clip_load < min(WEP_CVAR_PRI(electro, ammo), WEP_CVAR_SEC(electro, ammo))) { thiswep.wr_reload(thiswep, actor, weaponentity); return;