summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabs
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-15 03:14:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-15 03:14:04 +0300
commitb1fab9807bc9fc72573da82e42920ac14e7e4e6c (patch)
tree26b27648f35e037097817c3712e36ad134851b2d /src/gui/widgets/tabs
parent5fab1f9cd887c12ffcf129392582d634649c0122 (diff)
downloadmanaverse-b1fab9807bc9fc72573da82e42920ac14e7e4e6c.tar.gz
manaverse-b1fab9807bc9fc72573da82e42920ac14e7e4e6c.tar.bz2
manaverse-b1fab9807bc9fc72573da82e42920ac14e7e4e6c.tar.xz
manaverse-b1fab9807bc9fc72573da82e42920ac14e7e4e6c.zip
Not stop background music if not connected to server and settings was changed.
Diffstat (limited to 'src/gui/widgets/tabs')
-rw-r--r--src/gui/widgets/tabs/setup_audio.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp
index d6fc4e616..af23ad2fe 100644
--- a/src/gui/widgets/tabs/setup_audio.cpp
+++ b/src/gui/widgets/tabs/setup_audio.cpp
@@ -179,13 +179,23 @@ void Setup_Audio::apply()
if (config.getBoolValue("sound"))
{
soundManager.init();
- if (viewport && config.getBoolValue("playMusic"))
+ if (config.getBoolValue("playMusic"))
{
- const Map *const map = viewport->getMap();
- if (map)
- {
- soundManager.playMusic(map->getMusicFile(),
- SkipError_false);
+ if (viewport)
+ { // in game
+ const Map *const map = viewport->getMap();
+ if (map)
+ {
+ soundManager.playMusic(map->getMusicFile(),
+ SkipError_false);
+ }
+ }
+ else
+ { // not in game
+ soundManager.playMusic(branding.getValue(
+ "loginMusic",
+ "keprohm.ogg"),
+ SkipError_true);
}
}
else