Skip to content

Commit

Permalink
Fix to stop title music when unchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
niceeffort committed Jan 27, 2023
1 parent c657846 commit 52907a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/OpenLoco/src/Windows/Options.cpp
Expand Up @@ -863,6 +863,10 @@ namespace OpenLoco::Ui::Windows::Options
{
Audio::playMusic(Environment::PathId::css5, Config::get().old.volume, true);
}
else

This comment has been minimized.

Copy link
@AaronVanGeffen

AaronVanGeffen Jan 28, 2023

Member

This needs another check to verify we're not in-game. Wouldn't want the checkbox to stop unrelated music! :)

We could also just bail out of this function early if !isTitleScreen(). Just have to move the w->invalidate() call, in that case.

This comment has been minimized.

Copy link
@niceeffort

niceeffort Jan 28, 2023

Author Contributor

I'll give it another look. In game, it does start and stop the title music as it is written now, and overrides whatever song is playing. That should have been a problem before as well if you checked and unchecked the music. Thanks!

{
Audio::stopMusic();
}

w->invalidate();
}
Expand Down

1 comment on commit 52907a2

@niceeffort
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a fix for issue #1763

Please sign in to comment.