]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/cl_weaponsystem.qc
Include gmqcc binaries for Windows and Linux
[voretournament/voretournament.git] / data / qcsrc / server / cl_weaponsystem.qc
index 48058cca9e23864607b36b7c0aef2052aa229df1..7b005c8eb21a5602aaa1054513cf8f337dbd14c9 100644 (file)
@@ -407,21 +407,10 @@ void CL_Weaponentity_Think()
                                animfilename = strcat("models/weapons/h_", self.owner.weaponname, ".iqm.animinfo");\r
                                animfile = fopen(animfilename, FILE_READ);\r
                                // preset some defaults that work great for renamed zym files (which don't need an animinfo)\r
-                               self.anim_fire1  = '0 1 0.01';\r
-                               self.anim_fire2  = '1 1 0.01';\r
-                               self.anim_idle   = '2 1 0.01';\r
-                               self.anim_reload = '3 1 0.01';\r
-                               if (animfile >= 0)\r
-                               {\r
-                                       animparseerror = FALSE;\r
-                                       self.anim_fire1  = animparseline(animfile);\r
-                                       self.anim_fire2  = animparseline(animfile);\r
-                                       self.anim_idle   = animparseline(animfile);\r
-                                       self.anim_reload = animparseline(animfile);\r
-                                       fclose(animfile);\r
-                                       if (animparseerror)\r
-                                               print("Parse error in ", animfilename, ", some player animations are broken\n");\r
-                               }\r
+                               self.anim_fire1  = animfixfps(self, '0 1 0.01');\r
+                               self.anim_fire2  = animfixfps(self, '1 1 0.01');\r
+                               self.anim_idle   = animfixfps(self, '2 1 0.01');\r
+                               self.anim_reload = animfixfps(self, '3 1 0.01');\r
 \r
                                // if we have a "weapon" tag, let's attach the v_ model to it ("invisible hand" style model)\r
                                // if we don't, this is a "real" animated model\r
@@ -536,10 +525,10 @@ void CL_Weaponentity_Think()
                        self.movedir = '0 0 0';\r
                        self.spawnorigin = '0 0 0';\r
                        self.oldorigin = '0 0 0';\r
-                       self.anim_fire1  = '0 1 0.01';\r
-                       self.anim_fire2  = '0 1 0.01';\r
-                       self.anim_idle   = '0 1 0.01';\r
-                       self.anim_reload = '0 1 0.01';\r
+                       self.anim_fire1  = animfixfps(self, '0 1 0.01');\r
+                       self.anim_fire2  = animfixfps(self, '0 1 0.01');\r
+                       self.anim_idle   = animfixfps(self, '0 1 0.01');\r
+                       self.anim_reload = animfixfps(self, '0 1 0.01');\r
                }\r
 \r
                self.view_ofs = '0 0 0';\r
@@ -1247,10 +1236,20 @@ void weapon_thinkf(float fr, float t, void() func)
        if (t)\r
        if (!self.crouch) // shoot anim stands up, this looks bad\r
        {\r
-               local vector anim;\r
-               anim = self.anim_shoot;\r
-               anim_z = anim_y / (t + sys_frametime);\r
-               setanim(self, anim, FALSE, TRUE, TRUE);\r
+               vector anim;\r
+               if(self.weapon == WEP_GRABBER && self.BUTTON_ATCK2)\r
+               {\r
+                       // use melee attack animation for grabber alt fire\r
+                       anim = self.anim_melee;\r
+                       anim_z = anim_y / (t + sys_frametime);\r
+                       setanim(self, anim, FALSE, TRUE, TRUE);\r
+               }\r
+               else\r
+               {\r
+                       anim = self.anim_shoot;\r
+                       anim_z = anim_y / (t + sys_frametime);\r
+                       setanim(self, anim, FALSE, TRUE, TRUE);\r
+               }\r
        }\r
 };\r
 \r
@@ -1734,4 +1733,4 @@ void W_Reload(float sent_ammo_min, float sent_ammo_amount, float sent_time, stri
                self.clip_load = 0;\r
        self.old_clip_load = self.clip_load;\r
        self.clip_load = self.(weapon_load[self.weapon]) = -1;\r
-}
\ No newline at end of file
+}\r