From: terencehill Date: Mon, 4 Oct 2010 13:57:43 +0000 (+0200) Subject: - Fix typo in fireball code that was causing to: * being able to shoot with primary... X-Git-Tag: xonotic-v0.1.0preview~267^2~17 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=196b2ce6c0bf6cedd290f88084863f5ecb602b6e;p=xonotic%2Fxonotic-data.pk3dir.git - Fix typo in fireball code that was causing to: * being able to shoot with primary fire even if u don't have enough fuel, showing a wrong fuel progress bar because fuel quantity becomes negative * not being able to shoot with secondary fire if u have less than g_balance_fireball_primary_ammo fuel - Cleanup: use directly STAT_FUEL --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 6cde91110..e315a0214 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2258,12 +2258,10 @@ void HUD_HealthArmor(void) mySize -= '2 2 0' * panel_bg_padding; } - float armor, health; + float armor, health, fuel; armor = getstati(STAT_ARMOR); health = getstati(STAT_HEALTH); - - float fuel; - fuel = getstati(GetAmmoStat(4)); // how much fuel do we have? + fuel = getstati(STAT_FUEL); if(autocvar__hud_configure) { diff --git a/qcsrc/server/w_fireball.qc b/qcsrc/server/w_fireball.qc index 0827d2402..6b98d37cd 100644 --- a/qcsrc/server/w_fireball.qc +++ b/qcsrc/server/w_fireball.qc @@ -323,13 +323,13 @@ float w_fireball(float req) { if (self.BUTTON_ATCK) if (time >= self.fireball_primarytime) - if (weapon_prepareattack(1, cvar("g_balance_fireball_primary_refire"))) + if (weapon_prepareattack(0, cvar("g_balance_fireball_primary_refire"))) { W_Fireball_Attack1_Frame0(); self.fireball_primarytime = time + cvar("g_balance_fireball_primary_refire2"); } if (self.BUTTON_ATCK2) - if (weapon_prepareattack(0, cvar("g_balance_fireball_secondary_refire"))) + if (weapon_prepareattack(1, cvar("g_balance_fireball_secondary_refire"))) { W_Fireball_Attack2(); weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_fireball_secondary_animtime"), w_ready);