diff --git a/cs/engine/xrGame/ai/monsters/controller/controller.cpp b/cs/engine/xrGame/ai/monsters/controller/controller.cpp index 8cc0cfa63..26152e46d 100644 --- a/cs/engine/xrGame/ai/monsters/controller/controller.cpp +++ b/cs/engine/xrGame/ai/monsters/controller/controller.cpp @@ -498,7 +498,7 @@ void CController::net_Destroy() { inherited::net_Destroy(); - m_aura->on_death (); + m_aura->on_destroy (); FreeFromControl (); } diff --git a/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.cpp b/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.cpp index d2c3319c4..ce78de47c 100644 --- a/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.cpp +++ b/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.cpp @@ -27,6 +27,11 @@ void CPPEffectorControllerAura::switch_off() m_time_state_started = Device.dwTimeGlobal; } +void CPPEffectorControllerAura::terminate() +{ + if (m_snd_left._feedback()) m_snd_left.stop(); + if (m_snd_right._feedback()) m_snd_right.stop(); +} BOOL CPPEffectorControllerAura::update() { @@ -174,6 +179,15 @@ void CControllerAura::on_death() } } +void CControllerAura::on_destroy() +{ + if (active()) { + m_effector->terminate (); + m_effector = 0; + m_hit_state = eNone; + } +} + void CControllerAura::load(LPCSTR section) { inherited::load (pSettings->r_string(section,"aura_effector")); diff --git a/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.h b/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.h index d736f98e8..d126db67c 100644 --- a/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.h +++ b/cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.h @@ -27,6 +27,7 @@ class CPPEffectorControllerAura : public CPPEffectorCustom { CPPEffectorControllerAura (const SPPInfo &ppi, u32 time_to_fade, const ref_sound &snd_left, const ref_sound &snd_right); virtual BOOL update (); void switch_off (); + void terminate (); }; class CControllerAura : public CPPEffectorCustomController{ @@ -66,6 +67,7 @@ class CControllerAura : public CPPEffectorCustomController