void CExplosive::UpdateCL() { //VERIFY(!this->getDestroy()); VERIFY(!ph_world->Processing()); if(!m_explosion_flags.test(flExploding)) return;// !m_bExploding if(m_explosion_flags.test(flExploded)) { CGameObject* go=cast_game_object(); go->processing_deactivate(); m_explosion_flags.set(flExploding,FALSE);//m_bExploding = false; OnAfterExplosion(); return; } //время вышло, убираем объект взрывчатки if(m_fExplodeDuration < 0.f&&m_blasted_objects.empty()) { m_explosion_flags.set(flExploded,TRUE); StopLight(); // Msg("---------CExplosive OnAfterExplosion [%d] frame[%d]",cast_game_object()->ID(), Device.dwFrame); } else { m_fExplodeDuration -= Device.fTimeDelta; if (!m_bHideInExplosion && !m_bAlreadyHidden) { if (m_fExplodeHideDurationMax <= (m_fExplodeDurationMax - m_fExplodeDuration)) { HideExplosive(); } } UpdateExplosionPos(); UpdateExplosionParticles(); ExplodeWaveProcess(); //обновить подсветку взрыва if(m_pLight && m_pLight->get_active() && m_fLightTime>0) { if(m_fExplodeDuration > (m_fExplodeDurationMax - m_fLightTime)) { float scale = (m_fExplodeDuration - (m_fExplodeDurationMax - m_fLightTime))/m_fLightTime; m_pLight->set_color(m_LightColor.r*scale, m_LightColor.g*scale, m_LightColor.b*scale); m_pLight->set_range(m_fLightRange*scale); } else StopLight(); } } }
//подсветка от выстрела void CShootingObject::UpdateLight() { if (light_render && light_time>0) { light_time -= Device.fTimeDelta; if (light_time<=0) StopLight(); } }
void CWeapon::net_Destroy () { inherited::net_Destroy (); //удалить объекты партиклов StopFlameParticles (); StopFlameParticles2 (); StopLight (); Light_Destroy (); while (m_magazine.size()) m_magazine.pop_back(); }
void CExplosive::net_Destroy () { m_blasted_objects.clear (); StopLight (); m_explosion_flags.assign (0); }