WriteShort(channel, floor(this.origin.x / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(channel, floor(this.origin.y / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(channel, floor(this.origin.z / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(channel, floor(this.origin.x / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(channel, floor(this.origin.y / 4)); // not using a coord here, as gibs don't need this accuracy
WriteShort(channel, floor(this.origin.z / 4)); // not using a coord here, as gibs don't need this accuracy
return true;
}
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker)
return true;
}
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker)
e.state = type; // should stay smaller than 15
if(!sound_allowed(MSG_BROADCAST, gibowner) || !sound_allowed(MSG_BROADCAST, attacker))
e.state |= 0x40; // "silence" bit
e.state = type; // should stay smaller than 15
if(!sound_allowed(MSG_BROADCAST, gibowner) || !sound_allowed(MSG_BROADCAST, attacker))
e.state |= 0x40; // "silence" bit
// if this is a copied dead body, send the num of its player instead
// TODO: remove this field, read from model txt files
// if this is a copied dead body, send the num of its player instead
// TODO: remove this field, read from model txt files
- entity cl; FOR_EACH_REALCLIENT(cl) Violence_GibSplash_SendEntity(e, cl, 0);
- remove(e);
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), Violence_GibSplash_SendEntity(e, it, 0));
+ delete(e);
}
void Violence_GibSplash(entity source, float type, float amount, entity attacker)
}
void Violence_GibSplash(entity source, float type, float amount, entity attacker)
__pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
}
__pointparticles(ef, org, randomvec() * explosionspeed, howmany / 50);
}
// TODO maybe bounce of walls, make more gibs, etc.
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
// TODO maybe bounce of walls, make more gibs, etc.
if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
{
- if(!self.silent)
- sound(self, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
- __pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
+ if(!this.silent)
+ sound(this, CH_PAIN, SND_GIB_SPLAT_RANDOM(), VOL_BASE, ATTEN_NORM);
+ __pointparticles(_particleeffectnum(strcat(species_prefix(this.cnt), "blood")), this.origin + '0 0 1', '0 0 30', 10);
- if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
- // TODO somehow make it spray in a direction dependent on self.angles
- __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
+ if(gettouch(this) == Gib_Touch) // don't do this for the "chunk" thingie...
+ // TODO somehow make it spray in a direction dependent on this.angles
+ __trailparticles(this, _particleeffectnum(strcat(species_prefix(this.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, this.origin);
- __trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
+ __trailparticles(this, _particleeffectnum(strcat(species_prefix(this.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, this.origin);
// make gibs die faster at low view quality
// if view_quality is 0.5, we want to have them die twice as fast
// make gibs die faster at low view quality
// if view_quality is 0.5, we want to have them die twice as fast
- gib.move_velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
- gib.move_avelocity = prandomvec() * vlen(gib.move_velocity) * autocvar_cl_gibs_avelocity_scale;
+ gib.velocity = vconst * autocvar_cl_gibs_velocity_scale + vrand * autocvar_cl_gibs_velocity_random + '0 0 1' * autocvar_cl_gibs_velocity_up;
+ gib.avelocity = prandomvec() * vlen(gib.velocity) * autocvar_cl_gibs_avelocity_scale;