From 06251c1fe4c65a61a6d279368f4c9ee9d2dd6366 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Thu, 5 Jan 2012 19:00:32 +0200 Subject: [PATCH] Blacklist floating bones so the effect won't stick to them. I'm not a fan of doing it this way, and I wonder why those bones exist at all --- qcsrc/client/damage.qc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 12d1fcc7f..eb49470d7 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -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; } -- 2.39.2