]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
First part of bone-based damage effects: The origin of the effects is now a given...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Jan 2012 14:59:32 +0000 (16:59 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Jan 2012 14:59:32 +0000 (16:59 +0200)
qcsrc/client/damage.qc

index a9e8d4cbd46c0424c2b6165c5aa43333ebf0864a..eaa2fd4f9534771923ffe5e8289b1a34a274861f 100644 (file)
@@ -241,6 +241,7 @@ void DamageInfo_Precache()
 .entity dmgent;
 .float dmgpartnum, dmgtime;
 .float lifetime;
+.float bone;
 
 void DamageEffect_Think()
 {
@@ -257,9 +258,9 @@ void DamageEffect_Think()
        }
        if(self.dmgtime > time)
                return;
-       org = getplayerorigin(self.team);
-       if(org == GETPLAYERORIGIN_ERROR)
-               return;
+
+       org = gettaginfo(self.owner, self.bone);
+       //dprint(strcat(vtos(gettaginfo(self.owner, self.bone)), " --------\n"));
 
        // Scan the owner of all gibs in the world. If a gib owner is the same as the player we're applying
        // the effect to, it means our player is gibbed. Therefore, apply particles to the gibs instead.
@@ -327,6 +328,8 @@ void DamageEffect(float dmg, float type, float specnum, float entnumber)
 
        entity e;
        e = spawn();
+       e.owner = self;
+       e.bone = 0;
        e.classname = "damageeffect";
        e.team = entnumber;
        e.dmgpartnum = particleeffectnum(effectnum);