From: MirceaKitsune Date: Thu, 17 Nov 2011 17:26:45 +0000 (+0200) Subject: First functionality of the Grabber screen. Weapon load is now displayed properly... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=4a32cbc0f817d22e2860961580c7a8574a4e43d3;p=voretournament%2Fvoretournament.git First functionality of the Grabber screen. Weapon load is now displayed properly over the first two digits --- diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index 60bcbec6..2781dea0 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -1591,7 +1591,7 @@ void W_DisplayDigitThink() } entity gun; - if(self.team) // exterior weapon + if(self.wait) // exterior weapon { // keep the digit attached to the same bone as the gun setattachment(self, self.owner, "bip01 r hand"); @@ -1618,6 +1618,14 @@ void W_DisplayDigitThink() self.colormod = gun.colormod; // used by the regurgitating colors self.glowmod = gun.glowmod; + string txt; + if(self.team) // weapon load display + { + txt = ftos(self.owner.weapon_load[self.owner.switchweapon]); + txt = substring(txt, self.cnt - 1, 1); + self.skin = stof(txt); // if it's not a float it becomes 0 + } + self.nextthink = time; } @@ -1627,19 +1635,19 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior) digit = spawn(); digit.owner = own; digit.weapon = own.switchweapon; - digit.team = exterior; + digit.wait = exterior; + digit.team = load; + digit.cnt = num; e = get_weaponinfo(digit.weapon); if(load) { // weapon load digit - digit.cnt = 0; setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit1-", ftos(num) , ".md3")); } else { // ammo count digit - digit.cnt = 1; setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(num) , ".md3")); } digit.think = W_DisplayDigitThink;