]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Blacklist floating bones so the effect won't stick to them. I'm not a fan of doing...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 5 Jan 2012 17:00:32 +0000 (19:00 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 5 Jan 2012 17:00:32 +0000 (19:00 +0200)
qcsrc/client/damage.qc

index 12d1fcc7f045cf49cbeaf6d129043c9a4e935175..eb49470d7743135b5b638e9df7243121567842c2 100644 (file)
@@ -313,7 +313,12 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum)
                float closest;
                FOR_EACH_TAG(self)
                {
-                       // go through all skeletal bones on the player, and choose the one closest to impact origin
+                       // blacklist bones positioned outside the mesh, or the effect will be floating
+                       // TODO: Do we have to do it this way? Why do these bones exist at all?
+                       if(gettaginfo_name == "master" || gettaginfo_name == "knee_L" || gettaginfo_name == "knee_R" || gettaginfo_name == "leg_L" || gettaginfo_name == "leg_R")
+                               continue;
+
+                       // now choose the bone closest to impact origin
                        if(!closest || vlen(hitorg - gettaginfo(self, tagnum)) <= vlen(hitorg - gettaginfo(self, closest)))
                                closest = tagnum;
                }