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~307^2~29^2 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=0f24c7757072f52a9bb0e84f630467b45a46541e - 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 0f54a2857f..6b21f86a4f 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -2256,12 +2256,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 0827d2402f..6b98d37cd7 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);