void CVTOLVehicleManager::Init() { CGameAudio *pGameAudio = g_pGame->GetGameAudio(); m_explosionSignalId = pGameAudio->GetSignalID("ExplosionGenericLarge"); //CRY_ASSERT(m_explosionSignalId != INVALID_AUDIOSIGNAL_ID); m_pExplosionEffect = gEnv->pParticleManager->FindEffect(s_explosionEffectName); if (m_pExplosionEffect) { m_pExplosionEffect->AddRef(); } else { CryWarning(VALIDATOR_MODULE_GAME, VALIDATOR_ERROR, "Failed to find explosion effect %s", s_explosionEffectName); } CGameRules *pGameRules = g_pGame->GetGameRules(); m_moduleRMIIndex = pGameRules->RegisterModuleRMIListener(this); pGameRules->RegisterClientConnectionListener(this); }
//------------------------------------------ bool CC4Projectile::Init(IGameObject *pGameObject) { bool ok = CProjectile::Init(pGameObject); // C4 should always be saved (unlike other projectiles) IEntity* pEntity = GetEntity(); pEntity->SetFlags(pEntity->GetFlags() & ~ENTITY_FLAG_NO_SAVE); if(!gEnv->bServer) { CreateLight(); } if(gEnv->bMultiplayer) { CGameRules *pGameRules = g_pGame->GetGameRules(); pGameRules->RegisterTeamChangedListener(this); pGameRules->RegisterClientConnectionListener(this); } return ok; }