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

Controller roars playing before a savegame is loaded persist into that savegame #46

Open
SurDno opened this issue Nov 12, 2018 · 2 comments

Comments

@SurDno
Copy link
Contributor

SurDno commented Nov 12, 2018

Yes, I know that it is in 'Bugs still in the game' section of readme, I just wanted to say that it is listed as fixed in Shoker 1.9, just like #42.

@Decane
Copy link
Owner

Decane commented Mar 24, 2019

The ZRP has a work-around: kill any online controllers upon death of the player. That still leaves the bug present if the player reloads a save without dying. Perhaps the work-around could be extended to also trigger on net_destroy(). I'd rather have the bug fixed in the engine, though, since that's where it stems.

My analysis of the engine bug and a possible fix:

  • In xrGame\ai\monsters\controller\controller.cpp, we have:
void CController::net_Destroy()
{
	inherited::net_Destroy();

	m_aura->on_death	();
	FreeFromControl		();
}
  • CControllerAura::on_death() in xrGame\ai\monsters\controller\controller_psy_aura.cpp just calls m_effector->switch_off() and then nullifies pointer m_effector. But it doesn't actually terminate the looped controller roar sounds if they are playing when CController::net_Destroy() is called.

  • So I think the following modifications are required:

(1) Replace the m_aura->on_death() call in CController::net_Destroy() on xrGame\ai\monsters\controller\controller.cpp line 501 with:

m_aura->on_destroy();

(2) Add the following new public method declaration to class CControllerAura in xrGame\ai\monsters\controller\controller_psy_aura.h:

void on_destroy();

(3) Add the following new public method declaration to class CPPEffectorControllerAura in xrGame\ai\monsters\controller\controller_psy_aura.h:

void terminate();

(4) Add the following new method definitions to xrGame\ai\monsters\controller\controller_psy_aura.cpp:

void CPPEffectorControllerAura::terminate()
{
	if (m_snd_left._feedback()) m_snd_left.stop();
	if (m_snd_right._feedback()) m_snd_right.stop();
}
void CControllerAura::on_destroy()
{
	if (active()) {
		m_effector->terminate();
		m_effector = 0;
		m_hit_state = eNone;
	}
}

@SurDno
Copy link
Contributor Author

SurDno commented Mar 25, 2019

I also wanted to mention that Shoker 1.9 has no fix either, the author just disabled the aura in engine and reimplemented it via scripts. He says that his implementation is not ideal and works wrong when there is a wall between the player and the controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants