~CFlowExplosionInfoNode() { // safety unregister CGameRules *pGR = g_pGame->GetGameRules(); if(pGR) pGR->RemoveHitListener(this); }
void DoRegister(SActivationInfo *pActInfo) { CGameRules *pGR = g_pGame->GetGameRules(); if(!pGR) { GameWarning("[flow] CFlowExplosionInfoNode::DoRegister No GameRules!"); return; } bool bEnable = GetPortBool(pActInfo, EIP_Enable); if(bEnable) pGR->AddHitListener(this); else pGR->RemoveHitListener(this); }