From: Mircea Kitsune Date: Thu, 5 Jan 2012 17:00:32 +0000 (+0200) Subject: Blacklist floating bones so the effect won't stick to them. I'm not a fan of doing... X-Git-Tag: xonotic-v0.6.0~110^2^2~42 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=06251c1fe4c65a61a6d279368f4c9ee9d2dd6366;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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; }