]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Get digits to attach properly to the weapon model
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 15:52:07 +0000 (17:52 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 17 Nov 2011 15:52:07 +0000 (17:52 +0200)
data/qcsrc/server/cl_weaponsystem.qc
data/qcsrc/server/w_grabber.qc

index 34c9d9faeb8a81955fc8d3dc5a1f5865d30a2d5c..b7654b46200e038d3c613458a09ce2644cac88ea 100644 (file)
@@ -1591,42 +1591,40 @@ void W_DisplayThink()
                return;\r
        }\r
        self.nextthink = time;\r
-setattachment(self, self.owner.weaponentity.weaponentity, strcat("displaydigit_", ftos(self.cnt)));\r
-       //dprint(strcat(ftos(self.cnt), " --------\n"));\r
+\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
 }\r
 \r
-void W_DisplaySetup(entity own, float load_num, float load_scale, float ammo_num, float ammo_scale)\r
+void W_DisplaySetup(entity own, float load_num, float ammo_num)\r
 {\r
        float i;\r
        for(i = 1; i <= load_num + ammo_num; i += 1)\r
        {\r
-               entity digit;\r
+               entity digit, e;\r
                digit = spawn();\r
-               //setmodel(digit, "models/weapons/w_displaydigit.md3");\r
-               setmodel(digit, "models/items/g_h1.md3");\r
                digit.owner = own;\r
-               digit.weapon = own.weapon;\r
+               digit.weapon = own.switchweapon;\r
                digit.cnt = i;\r
+               digit.movetype = MOVETYPE_FOLLOW;\r
+               e = get_weaponinfo(digit.weapon);\r
 \r
                if(i <= load_num)\r
                {\r
                        // weapon load digit\r
                        digit.digit_type = 0;\r
-                       digit.scale = load_scale;\r
+                       setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit1-", ftos(i) , ".md3"));\r
                }\r
                else\r
                {\r
                        // ammo count digit\r
                        digit.digit_type = 1;\r
-                       digit.scale = ammo_scale;\r
+                       setmodel(digit, strcat("models/weapons/v_", e.netname, "_digit2-", ftos(i) , ".md3"));\r
                }\r
-\r
                digit.think = W_DisplayThink;\r
                digit.nextthink = time;\r
-               //digit.viewmodelforclient = own;\r
-               //setattachment(digit, own.weaponentity.weaponentity, "");\r
-\r
-               dprint(strcat(own.weaponentity.weaponentity.classname, " --------\n"));\r
        }\r
 }\r
 \r
index 98c4a38506a552b1be4955d050eeb775a8ea2b90..9e007f9fe580a4d39b3f09037c6795fb4af6f972 100644 (file)
@@ -214,7 +214,7 @@ 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_DisplaySetup(self, 2, 1, 3, 0.75);\r
+               W_DisplaySetup(self, 2, 3);\r
        }\r
        else if (req == WR_CHECKAMMO1)\r
        {\r