]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Use a better system for initiating weapon display digits, and don't attempt to attach...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 08:51:14 +0000 (10:51 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 15 Mar 2012 08:51:14 +0000 (10:51 +0200)
data/qcsrc/server/cl_weapons.qc
data/qcsrc/server/cl_weaponsystem.qc
data/qcsrc/server/w_grabber.qc
docs/TODO.txt

index 3599e378cfc96669c282450dd2081844fd1d74a0..e377a67b1ce32d6b659ac648429fdaa2bfdae1df 100644 (file)
@@ -348,6 +348,8 @@ void W_WeaponFrame()
                        self.weaponentity.state = WS_RAISE;\r
                        weapon_action(self.switchweapon, WR_SETUP);\r
 \r
+                       W_Display(self);\r
+\r
                        // set our clip load to the load of the weapon we switched to, if it's reloadable\r
                        entity e;\r
                        e = get_weaponinfo(self.switchweapon);\r
index ad316595c39e61bfa60fa606e555fe6a4a0c84ec..54670679781cef5acf5f69784c9f53112fb66304 100644 (file)
@@ -1597,6 +1597,8 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 \r
 void W_DisplayDigitThink()\r
 {\r
+       // dprint(strcat(ftos(gun.scale), " --------\n"));\r
+\r
        self.nextthink = time;\r
        float w_load, w_ammo;\r
        w_load = self.owner.weapon_load[self.owner.weapon];\r
@@ -1611,33 +1613,15 @@ void W_DisplayDigitThink()
                return;\r
        }\r
 \r
-       entity gun;\r
-       if(self.dmg) // exterior weapon\r
-       {\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 // view weapon\r
-       {\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
-               else if(gettagindex(self.owner.weaponentity, "tag_weapon"))\r
-                       setattachment(self, self.owner.weaponentity, "tag_weapon");\r
-               gun = self.owner.weaponentity;\r
-       }\r
-\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
-       self.effects = gun.effects;\r
-       self.alpha = gun.alpha;\r
-       self.colormap = gun.colormap;\r
-       self.colormod = gun.colormod; // used by the regurgitating colors\r
-       self.glowmod = gun.glowmod;\r
+       self.origin = self.weaponentity.origin;\r
+       self.angles = self.weaponentity.angles;\r
+       self.scale = self.weaponentity.scale;\r
+       self.effects = self.weaponentity.effects;\r
+       self.alpha = self.weaponentity.alpha;\r
+       self.colormap = self.weaponentity.colormap;\r
+       self.colormod = self.weaponentity.colormod; // used by the regurgitating colors\r
+       self.glowmod = self.weaponentity.glowmod;\r
 \r
        string txt;\r
        if(self.team) // weapon load display\r
@@ -1689,11 +1673,27 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior)
        digit = spawn();\r
        digit.owner = own;\r
        digit.weapon = own.weapon;\r
-       digit.dmg = exterior;\r
        digit.team = load;\r
        digit.cnt = num;\r
        e = get_weaponinfo(digit.weapon);\r
 \r
+       if(exterior) // exterior weapon\r
+       {\r
+               // keep the digit attached to the same bone as the gun\r
+               setattachment(digit, digit.owner, "bip01 r hand");\r
+               digit.weaponentity = digit.owner.exteriorweaponentity;\r
+       }\r
+       else // view weapon\r
+       {\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(digit.owner.weaponentity, "weapon"))\r
+                       setattachment(digit, digit.owner.weaponentity, "weapon");\r
+               else if(gettagindex(digit.owner.weaponentity, "tag_weapon"))\r
+                       setattachment(digit, digit.owner.weaponentity, "tag_weapon");\r
+               digit.weaponentity = digit.owner.weaponentity;\r
+       }\r
+\r
        if(load)\r
        {\r
                // weapon load digit\r
@@ -1708,15 +1708,18 @@ void W_DisplayDigitSetup(entity own, float num, float load, float exterior)
        digit.nextthink = time;\r
 }\r
 \r
-void W_Display(entity own, float load_num, float ammo_num)\r
+void W_Display(entity own)\r
 {\r
        float i;\r
-       for(i = 1; i <= load_num; i++)\r
+       entity e;\r
+       e = get_weaponinfo(own.weapon);\r
+\r
+       for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3")); i++)\r
        {\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++)\r
+       for(i = 1; fexists(strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3")); i++)\r
        {\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
index f0d34e0ee366bdcc842b2d86806bdb562469220e..b0b2c1378b87718ef9723e305af01bdcb20ed106 100644 (file)
@@ -219,7 +219,6 @@ float w_grabber(float req)
                weapon_setup(WEP_GRABBER);\r
                self.grabber_state &~= GRABBER_WAITING_FOR_RELEASE;\r
                self.current_ammo = ammo_fuel;\r
-               W_Display(self, 2, 3);\r
        }\r
        else if (req == WR_CHECKAMMO1)\r
        {\r
index dcc8631e8df8588e62dea1c8ed3707ca12e9df6e..a2afef3b3eedee9d6d652ae076ac291f9bbf30bb 100644 (file)
 \r
 - 0.8: Make menu song depend on menu skin?\r
 \r
-- 0.7: Make the insides of the color vixen character glow more
\ No newline at end of file
+- 0.7: Make the insides of the color vixen character glow more\r
+\r
+- 0.7 | 0.8: Always play the eating animations when the fire button is down?\r
+\r
+- 0.7 | 0.8: Rename fire keybinds to difference between weapon attach and vore attack?\r
+\r
+- 0.8 BUG: When you get stomach kicked, weapon reloading resets. Is this a bug, or does it actually work better?\r
+\r
+- 0.7: Move source branch to mediasource like Xonotic
\ No newline at end of file