From 6dff2908371d25aebd7c41c00cbafb9fe8f4b6b4 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 12 Apr 2011 18:43:24 +0300 Subject: [PATCH] Require letting go of both firing buttons before we can load again, if we abort with primary fire --- qcsrc/server/w_hagar.qc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 7ac477afd..b33e950aa 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -112,7 +112,7 @@ void W_Hagar_Attack2 (void) other = missile; MUTATOR_CALLHOOK(EditProjectile); } -.float hagar_loadtime; +.float hagar_loadtime, hagar_loadreset; void W_Hagar_Attack2_Load (void) { if not(weapon_action(self.weapon, WR_CHECKAMMO2)) @@ -140,16 +140,17 @@ void W_Hagar_Attack2_Load (void) { if(self.hagar_load) { - // if we press the primary fire button while loading rockets, unload them and abort + // if we press the primary fire button while loading rockets, unload them and abort the loading self.hagar_load = 0; sound(self, CHAN_WEAPON2, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM); } - // make sure we don't start loading again next frame after releasing the button - self.hagar_loadtime = time + autocvar_g_balance_hagar_secondary_load_speed; + // require letting go of both firing buttons before we can load again + self.hagar_loadreset = TRUE; } - else if(self.BUTTON_ATCK2 && !loaded && enough_ammo) + else if(self.BUTTON_ATCK2) { - // we can attempt to load another rocket + // check if we can attempt to load another rocket + if(!self.hagar_loadreset && !loaded && enough_ammo) if(self.hagar_loadtime < time) { self.hagar_load += 1; @@ -158,6 +159,10 @@ void W_Hagar_Attack2_Load (void) self.hagar_loadtime = time + autocvar_g_balance_hagar_secondary_load_speed; } } + else if(self.hagar_loadreset) + { + self.hagar_loadreset = FALSE; + } if(self.hagar_load) if(!self.BUTTON_ATCK2 || ((loaded || !enough_ammo) && self.hagar_loadtime < time && !autocvar_g_balance_hagar_secondary_load_hold)) -- 2.39.2