From: Mircea Kitsune Date: Tue, 12 Apr 2011 22:16:45 +0000 (+0300) Subject: Decrease ammo with each rocket we load, and not suddenly when firing. If the loading... X-Git-Tag: xonotic-v0.5.0~263^2~10^2~20 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2f8b796c02260d180a6b8e5ea63517e4808ca0b4;p=xonotic%2Fxonotic-data.pk3dir.git Decrease ammo with each rocket we load, and not suddenly when firing. If the loading is aborted, the ammo is then given back to the player (unless he dies). --- diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 24c2613bd..899c3866e 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -125,8 +125,6 @@ void W_Hagar_Attack2_Load_Release (void) if(!self.hagar_load) return; - W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load, autocvar_g_balance_hagar_reload_ammo); - W_SetupShot (self, FALSE, 2, "weapons/hagar_fire.wav", CHAN_WEAPON, autocvar_g_balance_hagar_secondary_damage); pointparticles(particleeffectnum("hagar_muzzleflash"), w_shotorg, w_shotdir * 1000, 1); @@ -210,6 +208,7 @@ void W_Hagar_Attack2_Load (void) if(self.hagar_load) { // if we pressed primary fire while loading, unload all rockets and abort + W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo * self.hagar_load * -1, autocvar_g_balance_hagar_reload_ammo); // give back ammo self.hagar_load = 0; sound(self, CHAN_WEAPON, "weapons/hagar_beep.wav", VOL_BASE, ATTN_NORM); @@ -226,6 +225,7 @@ void W_Hagar_Attack2_Load (void) if(!self.hagar_loadblock && !loaded && enough_ammo) if(self.hagar_loadstep < time) { + W_DecreaseAmmo(ammo_rockets, autocvar_g_balance_hagar_secondary_ammo, autocvar_g_balance_hagar_reload_ammo); self.hagar_load += 1; sound(self, CHAN_WEAPON2, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM);