]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/cl_player.qc
jump animation should not override melee anim until we have animation blending
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_player.qc
index c4bcded2805f99d4546ff023ddb27dee68b29eec..4de169221e6d976b66d8f3c2cd04927e31ba761c 100644 (file)
@@ -1,3 +1,7 @@
+.entity accuracy;
+.float accuracy_frags[WEP_MAXCOUNT];
+FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(accuracy_frags);
+
 float weaponstats_buffer;
 
 void WeaponStats_Init()
@@ -482,10 +486,13 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                                if(sv_gentle < 1) {
                                        if(self.classname != "body") // pain anim is BORKED on our ZYMs, FIXME remove this once we have good models
                                        {
-                                               if (random() > 0.5)
-                                                       setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
-                                               else
-                                                       setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               if (!self.animstate_override)
+                                               {
+                                                       if (random() > 0.5)
+                                                               setanim(self, self.anim_pain1, FALSE, TRUE, TRUE);
+                                                       else
+                                                               setanim(self, self.anim_pain2, FALSE, TRUE, TRUE);
+                                               }
                                        }
 
                                        if(sound_allowed(MSG_BROADCAST, attacker))
@@ -615,6 +622,14 @@ void PlayerDamage (entity inflictor, entity attacker, float damage, float deatht
                race_PreDie();
                DropAllRunes(self);
 
+        // increment frag counter for used weapon type
+        float w;
+        w = DEATH_WEAPONOF(deathtype);
+        if(WEP_VALID(w))
+        if(self.classname == "player")
+        if(self != attacker)
+        attacker.accuracy.(accuracy_frags[w-1]) += 1;
+
                if(deathtype == DEATH_HURTTRIGGER && g_freezetag)
                {
                        PutClientInServer();