Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed controller roars persisting into loaded savegames #20

Merged
merged 1 commit into from
Apr 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed controller roars persisting into loaded savegames
  • Loading branch information
Decane committed Apr 3, 2019
commit 3fec6f648c3a4de558a01a89cc4304ce95c4e920
2 changes: 1 addition & 1 deletion cs/engine/xrGame/ai/monsters/controller/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ void CController::net_Destroy()
{
inherited::net_Destroy();

m_aura->on_death ();
m_aura->on_destroy ();
FreeFromControl ();
}

Expand Down
14 changes: 14 additions & 0 deletions cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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"));
Expand Down
2 changes: 2 additions & 0 deletions cs/engine/xrGame/ai/monsters/controller/controller_psy_aura.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<CPPEffectorControllerAura>{
Expand Down Expand Up @@ -66,6 +67,7 @@ class CControllerAura : public CPPEffectorCustomController<CPPEffectorController
virtual void load (LPCSTR section);

void on_death ();
void on_destroy ();
void update_schedule ();
void update_frame ();
};
Expand Down