]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Attach the damage effect entity to the bone and use its origin, instead of not attach...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Jan 2012 16:35:17 +0000 (18:35 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Wed, 4 Jan 2012 16:35:17 +0000 (18:35 +0200)
qcsrc/client/Main.qc
qcsrc/client/damage.qc
qcsrc/client/gibs.qc
qcsrc/dpdefs/csprogsdefs.qc

index fd8afe117c49d2354e0768f3406eabd67b49fdf0..9e94a88f6c564738743be8375f82fdc7ee1c5b0a 100644 (file)
@@ -212,6 +212,8 @@ void CSQC_Init(void)
 
        hud_configure_prev = -1;
        tab_panel = -1;
+
+       precache_model("models/null.md3");
 }
 
 // CSQC_Shutdown : Called every time the CSQC code is shutdown (changing maps, quitting, etc)
index ebe7b2801198e3d146b22bd4b75d1edef5943ef7..ae7440500752c4d7af02eb93816609215dc181a2 100644 (file)
@@ -241,7 +241,6 @@ void DamageInfo_Precache()
 .entity dmgent;
 .float dmgpartnum, dmgtime;
 .float lifetime;
-.float bone;
 
 void DamageEffect_Think()
 {
@@ -262,7 +261,7 @@ void DamageEffect_Think()
                return; // if we aren't in third person mode, hide own damage effect
 
        // Now apply the effect to the player
-       org = gettaginfo(self.owner, self.bone);
+       org = gettaginfo(self, 0);
        pointparticles(self.dmgpartnum, org, '0 0 0', 1);
        self.dmgtime = time + autocvar_cl_damageeffect;
 }
@@ -302,15 +301,17 @@ void DamageEffect(vector hitorg, float dmg, float type, float specnum, float ent
        }
 
        float closest;
-       for(i = 1; gettaginfo(self, i); i++)
+       for(i = 0; gettaginfo(self, i); i++)
        {
                // go through all tags on the player model, choose the one closest to the damage origin
                if(!closest || vlen(hitorg - gettaginfo(self, i)) <= vlen(hitorg - gettaginfo(self, closest)))
                        closest = i;
        }
+       gettaginfo(self, closest); // set gettaginfo_name
+
        e = spawn();
-       e.owner = self;
-       e.bone = closest;
+       setmodel(e, "models/null.md3");
+       setattachment(e, self, gettaginfo_name);
        e.classname = "damageeffect";
        e.team = entnumber;
        e.dmgpartnum = particleeffectnum(effectnum);
index 38ca07e7f358aae4ef2a4aca797be1376c2893ca..22825bc4f38d4912b70c51922098c20213308581 100644 (file)
@@ -152,7 +152,7 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
 
 void Ent_GibSplash(float isNew)
 {
-       float amount, type, specnum, entnumber;
+       float amount, type, specnum;
        vector org, vel;
        string specstr;
        float issilent;
index 0d3088f9cfc3acb83e10eae556dea6acd0d748aa..f3003dbd638d88d721b73f795adb36e1260f8fef 100644 (file)
@@ -1405,3 +1405,10 @@ float trace_networkentity;
 const float RF_FULLBRIGHT      = 256;
 const float RF_NOSHADOW        = 512;
 float RF_DYNAMICMODELLIGHT = 8192;
+
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;