+static void net_gibshower(unsigned char num)
+{
+ int i, count;
+ float r, velocityscale;
+ vec3_t org;
+ double time;
+ localentity_t *e;
+ // need the time to know when the gibs should fade
+ time = CGVM_Time();
+ // read the network data
+ count = CGVM_MSG_ReadByte();
+ velocityscale = (float)(CGVM_MSG_ReadByte() * 100);
+ readvector(org);
+
+ for (i = 0;i < count;i++)
+ {
+ e = entspawn();
+ if (!e)
+ return;
+
+ VectorCopy(org, e->draw.origin);
+ e->draw.angles[0] = CGVM_RandomRange(0, 360);
+ e->draw.angles[1] = CGVM_RandomRange(0, 360);
+ e->draw.angles[2] = CGVM_RandomRange(0, 360);
+ VectorRandom(e->velocity);
+ VectorScale(e->velocity, velocityscale, e->velocity);
+ e->velocity[2] -= (float)(cg_gravity * 0.1);
+ e->avelocity[0] = CGVM_RandomRange(0, 1440);
+ e->avelocity[1] = CGVM_RandomRange(0, 1440);
+ e->avelocity[2] = CGVM_RandomRange(0, 1440);
+ r = CGVM_RandomRange(0, 3);
+ if (r < 1)
+ e->draw.model = CGVM_Model("progs/gib1.mdl");
+ else if (r < 2)
+ e->draw.model = CGVM_Model("progs/gib2.mdl");
+ else
+ e->draw.model = CGVM_Model("progs/gib3.mdl");
+ e->draw.alpha = 1;
+ e->draw.scale = 1;
+ e->draw.frame1 = 0;
+ e->draw.frame2 = 0;
+ e->draw.framelerp = 0;
+ e->draw.skinnum = 0;
+ VectorSet(e->worldmins, 0, 0, -8);
+ VectorSet(e->worldmaxs, 0, 0, -8);
+ VectorSet(e->entitymins, -8, -8, -8);
+ VectorSet(e->entitymaxs, 8, 8, 8);
+ e->bouncescale = 1.5;
+ e->gravityscale = 1;
+ e->airfrictionscale = 1;
+ e->framethink = gib_framethink;
+ e->touchnetwork = gib_touchnetwork;
+ e->dietime = (float)time + CGVM_RandomRange(3.0f, 5.0f);
+ }
+}
+