]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_fireball.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_fireball.qc
index e0f0748f4725b29b6153334bf4ecc71a1a74f8f6..4465aae9cacf3e454a3014292390cdea68c54c9d 100644 (file)
@@ -252,6 +252,13 @@ void W_Fireball_Attack1_Frame1()
 
 void W_Fireball_Attack1_Frame0()
 {
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_fireball_reload_ammo && self.clip_load < autocvar_g_balance_fireball_primary_ammo)
+       {
+               W_Fireball_Reload();
+               return;
+       }
+
        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {
@@ -313,6 +320,13 @@ void W_Fireball_Attack2()
        vector f_diff;
        float c;
 
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_fireball_reload_ammo && self.clip_load < autocvar_g_balance_fireball_secondary_ammo)
+       {
+               W_Fireball_Reload();
+               return;
+       }
+
        // if this weapon is reloadable, decrease its load. Else decrease the player's ammo
        if not(self.items & IT_UNLIMITED_WEAPON_AMMO)
        {