]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_hlac.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_hlac.qc
index 3a5ff0717cb203d313ca57929b1190cb7642950d..b07570b950a8ac4963fef70b076661e252f135c0 100644 (file)
@@ -76,6 +76,13 @@ void W_HLAC_Attack (void)
        local entity missile;
     float spread;
 
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < autocvar_g_balance_hlac_primary_ammo)
+       {
+               W_HLAC_Reload();
+               return;
+       }
+
        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
@@ -177,6 +184,13 @@ void W_HLAC_Attack2 (void)
 {
     float i;
 
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_hlac_reload_ammo && self.clip_load < autocvar_g_balance_hlac_secondary_ammo)
+       {
+               W_HLAC_Reload();
+               return;
+       }
+
        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {