Script:Files:script/projectiles/grenade.script

From Mod Wiki
Revision as of 09:51, 5 November 2007 by Wizz (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
/***********************************************************************

grenade.script - ONLY used by the bots to track the death of grenades.

***********************************************************************/

object projectile_grenade : projectile_missile {
    void BotOnExplode(); 
}

void projectile_grenade::BotOnExplode() {
    if ( !sys.isClient() ) {
        float isStroyBomb = getFloatKey( "is_stroybomb" );

        if ( isStroyBomb ) {
            return;
        }

        player p = getOwner();

        if ( p != $null_entity ) {
            p.setPlayerGrenadeState( self, true );
        }
    }
}

void projectile_grenade::vOnLocalMapRestart() {
    killEffect( "fx_trail" );
}