]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_electro.qc
nex charge: properly support g_use_ammunition; don't bite off more than you can chew...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_electro.qc
index 4bee058f0fcff973d2d2173332b819559b8f91af..2268ca7cb150a558e9f83d325027213b238b4beb 100644 (file)
@@ -238,8 +238,10 @@ void lgbeam_think()
        if not(self.owner.items & IT_UNLIMITED_WEAPON_AMMO)
        {
                if(cvar("g_balance_electro_primary_ammo"))
-                       dt = min(frametime, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
-               self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+               {
+                       dt = min(dt, self.owner.ammo_cells / cvar("g_balance_electro_primary_ammo"));
+                       self.owner.ammo_cells = max(0, self.owner.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
+               }
        }
 
        W_SetupShot_Range(self.owner, TRUE, 0, "", cvar("g_balance_electro_primary_damage") * dt, cvar("g_balance_electro_primary_range"));