mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 06:44:38 +01:00
Fix #7544: Freeze when starting headless server with no arguments
Fixes #7313: Loading an invalid path with openrct2 produces results different than expected Do not load title sequences in headless mode and prevent use of null audio mixer when ride music is stopped.
This commit is contained in:
@@ -657,9 +657,20 @@ namespace OpenRCT2
|
||||
void Launch()
|
||||
{
|
||||
gIntroState = INTRO_STATE_NONE;
|
||||
if ((gOpenRCT2StartupAction == STARTUP_ACTION_TITLE) && gConfigGeneral.play_intro)
|
||||
if (gOpenRCT2Headless)
|
||||
{
|
||||
gOpenRCT2StartupAction = STARTUP_ACTION_INTRO;
|
||||
// NONE or OPEN are the only allowed actions for headless mode
|
||||
if (gOpenRCT2StartupAction != STARTUP_ACTION_OPEN)
|
||||
{
|
||||
gOpenRCT2StartupAction = STARTUP_ACTION_NONE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gOpenRCT2StartupAction == STARTUP_ACTION_TITLE) && gConfigGeneral.play_intro)
|
||||
{
|
||||
gOpenRCT2StartupAction = STARTUP_ACTION_INTRO;
|
||||
}
|
||||
}
|
||||
|
||||
switch (gOpenRCT2StartupAction) {
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
enum STARTUP_ACTION
|
||||
{
|
||||
STARTUP_ACTION_NONE,
|
||||
STARTUP_ACTION_INTRO,
|
||||
STARTUP_ACTION_TITLE,
|
||||
STARTUP_ACTION_OPEN,
|
||||
|
||||
@@ -74,7 +74,11 @@ void * Mixer_Play_Effect(size_t id, sint32 loop, sint32 volume, float pan, doubl
|
||||
|
||||
void Mixer_Stop_Channel(void * channel)
|
||||
{
|
||||
GetMixer()->Stop(static_cast<IAudioChannel*>(channel));
|
||||
auto mixer = GetMixer();
|
||||
if (mixer != nullptr)
|
||||
{
|
||||
mixer->Stop(static_cast<IAudioChannel*>(channel));
|
||||
}
|
||||
}
|
||||
|
||||
void Mixer_Channel_Volume(void * channel, sint32 volume)
|
||||
|
||||
Reference in New Issue
Block a user