]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Get the damage effects PARTLY working again. They will only show on team mates so...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 25 Aug 2011 14:44:01 +0000 (17:44 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Thu, 25 Aug 2011 14:44:01 +0000 (17:44 +0300)
qcsrc/client/damage.qc

index fe2e8b67b0488a28d7f759bad87c435715ff7216..6a5855fe42ab65200e20207123244fce8a4c52ab 100644 (file)
@@ -236,7 +236,7 @@ void DamageInfo_Precache()
 }
 
 .entity dmgeffect;
-.string dmgparticles;
+.float partnum;
 
 void Ent_DamageEffect_Think()
 {
@@ -256,18 +256,16 @@ void Ent_DamageEffect_Think()
                {
                        if(head.team == self.team)
                        if(random() < autocvar_cl_damageeffect_gibs)
-                               pointparticles(particleeffectnum(self.dmgparticles), head.origin, '0 0 0', 1);
+                               pointparticles(self.partnum, head.origin, '0 0 0', 1);
                }
        }
 
        // if we aren't in third person mode, hide our own damage effect
-       if(self.team == player_localentnum)
-       if(!autocvar_chase_active)
+       if(self.team == player_localentnum && !autocvar_chase_active)
                return;
 
        // Now apply the effect to the actual player.
-       if(random() < autocvar_cl_damageeffect)
-               pointparticles(particleeffectnum(self.dmgparticles), entcs.origin, '0 0 0', 1);
+               pointparticles(self.partnum, entcs.origin, '0 0 0', 1);
 }
 
 void Ent_DamageEffect()
@@ -305,7 +303,7 @@ void Ent_DamageEffect()
        entity head;
        for(head = world; (head = find(head, classname, "dmgeffect")); )
        {
-               if(head.team == entnumber)
+               if(head.team == entnumber - 1)
                {
                        remove(head);
                        head = world;
@@ -315,8 +313,8 @@ void Ent_DamageEffect()
        entity e;
        e = spawn();
        e.classname = "dmgeffect";
-       e.team = entnumber;
-       e.dmgparticles = effectnum;
+       e.team = entnumber - 1;
+       e.partnum = particleeffectnum(effectnum);
        e.think = Ent_DamageEffect_Think;
        e.nextthink = time;
 }