From 4a32cbc0f817d22e2860961580c7a8574a4e43d3 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Thu, 17 Nov 2011 19:26:45 +0200 Subject: [PATCH] First functionality of the Grabber screen. Weapon load is now displayed properly over the first two digits --- data/qcsrc/server/cl_weaponsystem.qc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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; -- 2.39.2