diff options
Diffstat (limited to 'engines/sci/engine/game.cpp')
-rw-r--r-- | engines/sci/engine/game.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index e2ca19b51f..250610dfb7 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -799,17 +799,21 @@ int game_init(EngineState *s) { s->menubar = menubar_new(); // Create menu bar + if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND) + game_init_sound(s, 0); + return 0; } int game_exit(EngineState *s) { - if (s->execution_stack) { + if (s->execution_stack) free(s->execution_stack); - } - sfx_exit(&s->sound); - // Reinit because some other code depends on having a valid state - game_init_sound(s, SFX_STATE_FLAG_NOSOUND); + if (!s->successor) { + sfx_exit(&s->sound); + // Reinit because some other code depends on having a valid state + game_init_sound(s, SFX_STATE_FLAG_NOSOUND); + } delete s->seg_manager; |