From: MirceaKitsune Date: Thu, 17 Nov 2011 16:37:56 +0000 (+0200) Subject: Minor digit code tweaks X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=196da1686f9ef4ebe449953c9b5a05a02e76bc69;p=voretournament%2Fvoretournament.git Minor digit code tweaks --- diff --git a/data/qcsrc/server/cl_weaponsystem.qc b/data/qcsrc/server/cl_weaponsystem.qc index f78d20f7..60bcbec6 100644 --- a/data/qcsrc/server/cl_weaponsystem.qc +++ b/data/qcsrc/server/cl_weaponsystem.qc @@ -1579,10 +1579,10 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread) #define W_SETUPPROJECTILEVELOCITY_UP(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), cvar(#s "_speed_up"), cvar(#s "_speed_z"), cvar(#s "_spread")) #define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread")) -void W_DisplayThink() +void W_DisplayDigitThink() { // the owner has switched to another weapon, remove the digits - if(self.weapon != self.owner.weapon) + if(self.weapon != self.owner.switchweapon) { self.nextthink = 0; remove(self); @@ -1591,15 +1591,15 @@ void W_DisplayThink() } entity gun; - if(self.team) // exterior weapon model + if(self.team) // exterior weapon { - // keep the digit attached to the same bone as the weapon model + // keep the digit attached to the same bone as the gun setattachment(self, self.owner, "bip01 r hand"); gun = self.owner.exteriorweaponentity; } - else + else // view weapon { - // keep the digit attached to the same bone as the weapon model + // keep the digit attached to the same bone as the gun // TODO: Does this work with self-animated weapons too? if(gettagindex(self.owner.weaponentity, "weapon")) setattachment(self, self.owner.weaponentity, "weapon"); @@ -1608,7 +1608,7 @@ void W_DisplayThink() gun = self.owner.weaponentity.weaponentity; } - // copy all properties of the weapon model to the digit + // copy all properties of the weapon to the digit self.origin = gun.origin; self.angles = gun.angles; self.scale = gun.scale; @@ -1621,7 +1621,7 @@ void W_DisplayThink() self.nextthink = time; } -void W_DisplaySetup(entity own, float num, float load, float exterior) +void W_DisplayDigitSetup(entity own, float num, float load, float exterior) { entity digit, e; digit = spawn(); @@ -1642,22 +1642,22 @@ void W_DisplaySetup(entity own, float num, float load, float exterior) digit.cnt = 1; setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(num) , ".md3")); } - digit.think = W_DisplayThink; + digit.think = W_DisplayDigitThink; digit.nextthink = time; } void W_Display(entity own, float load_num, float ammo_num) { float i; - for(i = 1; i <= load_num; i += 1) + for(i = 1; i <= load_num; i++) { - W_DisplaySetup(own, i, TRUE, FALSE); // weapon load digit, view model - W_DisplaySetup(own, i, TRUE, TRUE); // weapon load digit, exterior model + W_DisplayDigitSetup(own, i, TRUE, FALSE); // weapon load digit, view model + W_DisplayDigitSetup(own, i, TRUE, TRUE); // weapon load digit, exterior model } - for(i = 1; i <= ammo_num; i += 1) + for(i = 1; i <= ammo_num; i++) { - W_DisplaySetup(own, i, FALSE, FALSE); // ammo count digit, view model - W_DisplaySetup(own, i, FALSE, TRUE); // ammo count digit, exterior model + W_DisplayDigitSetup(own, i, FALSE, FALSE); // ammo count digit, view model + W_DisplayDigitSetup(own, i, FALSE, TRUE); // ammo count digit, exterior model } }