From: MirceaKitsune Date: Thu, 15 Mar 2012 10:15:06 +0000 (+0200) Subject: Make weapon display warn amount depend on weapon and ammo instead of a global cvar... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b2b2797d1968e5c3280d5e7ef6d2d7b68a974659;p=voretournament%2Fvoretournament.git Make weapon display warn amount depend on weapon and ammo instead of a global cvar. We currently have one gun and one ammo, but still do this because it's more correct and flexible --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index ee55db0c..5e5580c6 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -650,8 +650,8 @@ set g_multijump 1 "Number of multiple jumps to allow (jumping again in the air), set g_multijump_add 0 "0 = make the current z velocity equal to jumpvelocity, 1 = add jumpvelocity to the current z velocity" set g_multijump_speed -125 "Minimum vertical speed a player must have in order to jump again" -set g_gundisplay_warn_load 10 "display digits will show in warning mode when weapon load is below this amount" -set g_gundisplay_warn_ammo 50 "display digits will show in warning mode when ammo is below this amount" +set g_gundisplay_warn_weapon_grabber 10 "display digits will show in warning mode when grabber weapon load is below this amount" +set g_gundisplay_warn_ammo_fuel 50 "display digits will show in warning mode when fuel ammo is below this amount" // effects r_glsl_postprocess 1 diff --git a/data/qcsrc/server/cl_weapons.qc b/data/qcsrc/server/cl_weapons.qc index 5392812c..c72add36 100644 --- a/data/qcsrc/server/cl_weapons.qc +++ b/data/qcsrc/server/cl_weapons.qc @@ -352,7 +352,9 @@ void W_DisplayDigitThink() txt = substring(txt, self.cnt - 1, 1); } - if(self.owner.weapon_load[self.owner.weapon] <= ceil(cvar("g_gundisplay_warn_load"))) + entity e; + e = get_weaponinfo(self.owner.weapon); + if(self.owner.weapon_load[self.owner.weapon] <= cvar(strcat("g_gundisplay_warn_weapon_", e.netname))) { // in warning mode, only keep red color if(!self.colormod) @@ -366,7 +368,7 @@ void W_DisplayDigitThink() txt = ftos(floor(w_ammo)); txt = substring(txt, self.cnt - 1, 1); - if(w_ammo <= ceil(cvar("g_gundisplay_warn_ammo"))) + if(w_ammo <= cvar(strcat("g_gundisplay_warn_ammo_", Item_CounterFieldName(W_AmmoItemCode(self.owner.weapon))))) { // in warning mode, only keep red color if(!self.colormod) diff --git a/docs/TODO.txt b/docs/TODO.txt index 8088893a..60f58836 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -126,8 +126,6 @@ - 0.7 | 0.8 BUG: Names still show for eaten players. -- 0.7 | 0.8 BUG: Display digits still disappear after changing maps (but never on the first map) - - 0.8: Make menu song depend on menu skin? - 0.7: Make the insides of the color vixen character glow more @@ -144,8 +142,6 @@ - 0.7 | 0.8 BUG: Bots can still senect no weapon when they have the grabber -- 0.7: Fix cvar amount to use percentage for making display digits red - - 0.7 | 0.8: Maybe allow damage gained from digestion to go up to 250 - 0.7 | 0.8: Don't rocket prey out when the predator is dead (use a cvar for this)