]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/w_shotgun.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_shotgun.qc
index acf65a1f98dbb71582f0b71f8597293dc998a970..f38076deb2928a0baad8ce88aec0658b1e884999 100644 (file)
@@ -69,6 +69,13 @@ void W_Shotgun_Attack (void)
        float   bulletconstant;
        local entity flash;
 
+       // if there's not enough ammo for this attack (but we still have the weapon), reload
+       if(autocvar_g_balance_shotgun_reload_ammo && self.clip_load < autocvar_g_balance_shotgun_primary_ammo)
+       {
+               W_Shotgun_Reload();
+               return;
+       }
+
        ammoamount = autocvar_g_balance_shotgun_primary_ammo;
        bullets = autocvar_g_balance_shotgun_primary_bullets;
        d = autocvar_g_balance_shotgun_primary_damage;