never go below 0 cells
authorRudolf Polzer <divverent@alientrap.org>
Sun, 18 Jul 2010 16:39:47 +0000 (18:39 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 18 Jul 2010 16:39:47 +0000 (18:39 +0200)
qcsrc/server/w_electro.qc

index 330adee..5e52e39 100644 (file)
@@ -223,7 +223,7 @@ void exteriorlgbeam_think()
        }
 
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
-               self.ammo_cells = self.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime;
+               self.ammo_cells = max(0, self.ammo_cells - cvar("g_balance_electro_primary_ammo") * frametime);
 
        self.nextthink = time;