summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-24 04:29:03 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-24 04:29:03 +0300
commit9ba40776e3b0b00235e821c1157c6b4e0245417d (patch)
tree1934b95a1c73818d9e6f6d77d04b8daa8ef79e59 /src/resources
parent3e5dbaaa903d4f4ea039902ab83259cb1e11a2f4 (diff)
downloadmv-9ba40776e3b0b00235e821c1157c6b4e0245417d.tar.gz
mv-9ba40776e3b0b00235e821c1157c6b4e0245417d.tar.bz2
mv-9ba40776e3b0b00235e821c1157c6b4e0245417d.tar.xz
mv-9ba40776e3b0b00235e821c1157c6b4e0245417d.zip
Fix asserts with missing default music files.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/mapreader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 7c3c0a2ca..b5cad0661 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -50,6 +50,7 @@
#include "utils/base64.h"
#include "utils/delete2.h"
+#include "utils/physfstools.h"
#include "utils/stringmap.h"
#include <zlib.h>
@@ -1209,5 +1210,6 @@ void MapReader::updateMusic(Map *const map)
if (p != std::string::npos)
name = name.substr(0, p);
name.append(".ogg");
- map->setProperty("music", name);
+ if (PhysFs::exists(paths.getStringValue("music").append(name).c_str()))
+ map->setProperty("music", name);
}