]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_minelayer.qc
Reload if we don't have ammo for a certain attack. Prevents situations in which you...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / w_minelayer.qc
index d46342ccc25d19c9c24cfc3ec914ba8e6cd620be..8efb7566cf23ffa3cc999d0f8cdfe2c4429e8a35 100644 (file)
@@ -268,6 +268,13 @@ void W_Mine_Attack (void)
                }
        }
 
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_minelayer_reload_ammo && self.clip_load < autocvar_g_balance_minelayer_ammo)
+       {
+               W_MineLayer_Reload();
+               return;
+       }
+
        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {