]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
simplify electro clip reload
authordrjaska <drjaska83@gmail.com>
Thu, 29 Dec 2022 17:53:50 +0000 (19:53 +0200)
committerdrjaska <drjaska83@gmail.com>
Thu, 29 Dec 2022 17:53:50 +0000 (19:53 +0200)
qcsrc/common/weapons/weapon/electro.qc

index 97929c7dd3736ba0cf68514562ae32fc995954e0..d7ff581c6210b2d37fee7c25b7a5019b6900f1d3 100644 (file)
@@ -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;