From c649bee098d90abdbd1b23a77c846d2b3708092e Mon Sep 17 00:00:00 2001 From: drjaska Date: Thu, 29 Dec 2022 19:53:50 +0200 Subject: [PATCH] simplify electro clip reload --- qcsrc/common/weapons/weapon/electro.qc | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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; -- 2.39.2