void GrenadeTouch() { if ( other == PROG_TO_EDICT( self->s.v.owner ) ) return; // don't explode on owner if ( other->s.v.takedamage == DAMAGE_AIM ) { GrenadeExplode(); return; } sound( self, CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM ); // bounce sound if ( self->s.v.velocity[0] == 0 && self->s.v.velocity[1] == 0 && self->s.v.velocity[2] == 0 ) VectorClear( self->s.v.avelocity ); }
//========================================================= void CQuakeRocket::GrenadeTouch( CBaseEntity *pOther ) { if (pOther->pev->takedamage == DAMAGE_AIM) { GrenadeExplode(); return; } if (pev->flags & FL_ONGROUND) { // add a bit of static friction pev->velocity = pev->velocity * 0.75; if (pev->velocity.Length() <= 20) { pev->avelocity = g_vecZero; } } EMIT_SOUND(ENT(pev), CHAN_WEAPON, "weapons/bounce.wav", 1, ATTN_NORM); if (pev->velocity == g_vecZero) pev->avelocity = g_vecZero; }