From: Mircea Kitsune Date: Tue, 12 Apr 2011 16:27:53 +0000 (+0300) Subject: Another change to the buttons, making them work much better X-Git-Tag: xonotic-v0.5.0~263^2~10^2~34 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1bf795df04a33ce72adfd5fb945430179ddc629e;p=xonotic%2Fxonotic-data.pk3dir.git Another change to the buttons, making them work much better --- diff --git a/qcsrc/server/w_hagar.qc b/qcsrc/server/w_hagar.qc index 23396b889..ee1621e52 100644 --- a/qcsrc/server/w_hagar.qc +++ b/qcsrc/server/w_hagar.qc @@ -144,12 +144,13 @@ void W_Hagar_Attack2_Load (void) { if(self.hagar_load) { - // if we press the primary fire button while loading rockets, unload them and abort the loading + // if we pressed primary fire while loading, unload all rockets and abort self.hagar_load = 0; sound(self, CHAN_WEAPON2, "weapons/hagar_load.wav", VOL_BASE, ATTN_NORM); + + // require letting go of the alt fire button before we can load again + self.hagar_loadreset = TRUE; } - // require letting go of both firing buttons before we can load again - self.hagar_loadreset = TRUE; } else { @@ -166,7 +167,7 @@ void W_Hagar_Attack2_Load (void) } else if(self.hagar_loadreset) { - // both firing buttons were released, which means we can load again + // the alt fire button was released, so re-enable loading if blocked self.hagar_loadreset = FALSE; } @@ -260,9 +261,8 @@ float w_hagar(float req) if (loadable_secondary) W_Hagar_Attack2_Load(); // must run each frame, even when no firing buttons are pressed - if (self.BUTTON_ATCK && !(self.BUTTON_ATCK2 && loadable_secondary)) + if (self.BUTTON_ATCK && !self.hagar_load && !self.hagar_loadreset) // not while secondary is loaded or awaiting reset { - if (!self.hagar_load) // not while the secondary fire is loaded if (weapon_prepareattack(0, autocvar_g_balance_hagar_primary_refire)) { W_Hagar_Attack();