]> git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Minor digit code tweaks
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 16:37:56 +0000 (18:37 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 16:37:56 +0000 (18:37 +0200)
data/qcsrc/server/cl_weaponsystem.qc

index f78d20f7375f35e858987f1699c8574b1a2a9177..60bcbec6a2f7cd4d2b8f974e146f3c0e262181e6 100644 (file)
@@ -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"))\r
 #define W_SETUPPROJECTILEVELOCITY(m,s) W_SetupProjectileVelocityEx(m, w_shotdir, v_up, cvar(#s "_speed"), 0, 0, cvar(#s "_spread"))\r
 \r
-void W_DisplayThink()\r
+void W_DisplayDigitThink()\r
 {\r
        // the owner has switched to another weapon, remove the digits\r
-       if(self.weapon != self.owner.weapon)\r
+       if(self.weapon != self.owner.switchweapon)\r
        {\r
                self.nextthink = 0;\r
                remove(self);\r
@@ -1591,15 +1591,15 @@ void W_DisplayThink()
        }\r
 \r
        entity gun;\r
-       if(self.team) // exterior weapon model\r
+       if(self.team) // exterior weapon\r
        {\r
-               // keep the digit attached to the same bone as the weapon model\r
+               // keep the digit attached to the same bone as the gun\r
                setattachment(self, self.owner, "bip01 r hand");\r
                gun = self.owner.exteriorweaponentity;\r
        }\r
-       else\r
+       else // view weapon\r
        {\r
-               // keep the digit attached to the same bone as the weapon model\r
+               // keep the digit attached to the same bone as the gun\r
                // TODO: Does this work with self-animated weapons too?\r
                if(gettagindex(self.owner.weaponentity, "weapon"))\r
                        setattachment(self, self.owner.weaponentity, "weapon");\r
@@ -1608,7 +1608,7 @@ void W_DisplayThink()
                gun = self.owner.weaponentity.weaponentity;\r
        }\r
 \r
-       // copy all properties of the weapon model to the digit\r
+       // copy all properties of the weapon to the digit\r
        self.origin = gun.origin;\r
        self.angles = gun.angles;\r
        self.scale = gun.scale;\r
@@ -1621,7 +1621,7 @@ void W_DisplayThink()
        self.nextthink = time;\r
 }\r
 \r
-void W_DisplaySetup(entity own, float num, float load, float exterior)\r
+void W_DisplayDigitSetup(entity own, float num, float load, float exterior)\r
 {\r
        entity digit, e;\r
        digit = spawn();\r
@@ -1642,22 +1642,22 @@ void W_DisplaySetup(entity own, float num, float load, float exterior)
                digit.cnt = 1;\r
                setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(num) , ".md3"));\r
        }\r
-       digit.think = W_DisplayThink;\r
+       digit.think = W_DisplayDigitThink;\r
        digit.nextthink = time;\r
 }\r
 \r
 void W_Display(entity own, float load_num, float ammo_num)\r
 {\r
        float i;\r
-       for(i = 1; i <= load_num; i += 1)\r
+       for(i = 1; i <= load_num; i++)\r
        {\r
-               W_DisplaySetup(own, i, TRUE, FALSE); // weapon load digit, view model\r
-               W_DisplaySetup(own, i, TRUE, TRUE); // weapon load digit, exterior model\r
+               W_DisplayDigitSetup(own, i, TRUE, FALSE); // weapon load digit, view model\r
+               W_DisplayDigitSetup(own, i, TRUE, TRUE); // weapon load digit, exterior model\r
        }\r
-       for(i = 1; i <= ammo_num; i += 1)\r
+       for(i = 1; i <= ammo_num; i++)\r
        {\r
-               W_DisplaySetup(own, i, FALSE, FALSE); // ammo count digit, view model\r
-               W_DisplaySetup(own, i, FALSE, TRUE); // ammo count digit, exterior model\r
+               W_DisplayDigitSetup(own, i, FALSE, FALSE); // ammo count digit, view model\r
+               W_DisplayDigitSetup(own, i, FALSE, TRUE); // ammo count digit, exterior model\r
        }\r
 }\r
 \r