]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Send the dead body / gibbed status as a separate WriteByte. I really see no other...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Apr 2011 21:07:32 +0000 (00:07 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 10 Apr 2011 21:07:32 +0000 (00:07 +0300)
qcsrc/client/gibs.qc
qcsrc/server/g_violence.qc

index 7239fffe283c4094f490e6ecbbd4af7164aa2e5a..2f552c20e90b41860f94d968f97be5c59f243a9a 100644 (file)
@@ -140,7 +140,7 @@ void TossGib (string mdlname, vector org, vector vconst, vector vrand, float spe
 
 void Ent_GibSplash(float isNew)
 {
-       float amount, type, specnum, entnumber;
+       float amount, type, specnum, entnumber, body;
        vector org, vel;
        string specstr;
        float issilent;
@@ -151,6 +151,7 @@ void Ent_GibSplash(float isNew)
        type = ReadByte(); // gibbage type
        amount = ReadByte() / 16.0; // gibbage amount
        entnumber = ReadByte(); // player num
+       body = ReadByte(); // is dead body / gibbed
        org_x = ReadShort() * 4 + 2;
        org_y = ReadShort() * 4 + 2;
        org_z = ReadShort() * 4 + 2;
index 0cc997bb0d3c6b0cafc9c32e6b4bbf504debd669..1c3c8d04ec3edbc1465a9517c57682e587117f5a 100644 (file)
@@ -64,6 +64,7 @@ float Violence_DamageEffect_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, self.cnt); // damage weapon
        WriteByte(MSG_ENTITY, self.state); // player species
        WriteByte(MSG_ENTITY, self.team); // player entnum
+       WriteByte(MSG_ENTITY, self.deadflag); // is dead body / gibbed
        WriteCoord(MSG_ENTITY, floor(self.origin_x));
        WriteCoord(MSG_ENTITY, floor(self.origin_y));
        WriteCoord(MSG_ENTITY, floor(self.origin_z));
@@ -85,6 +86,12 @@ void Violence_DamageEffect(entity pl, float type)
        else
                e.team = num_for_edict(pl);
 
+       // is this a whole dead body, or a gibbed body / player?
+       if(!pl.modelindex) // gibbed
+               e.deadflag = 2;
+       else if(pl.classname == "body")
+               e.deadflag = 1;
+
        // if the player is dead, show the effect lower, else it appears floating above the body
        if(pl.health <= 0)
                setorigin(e, pl.origin - '0 0 25');