summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiels Martin Hansen <nielsm@indvikleren.dk>2018-09-03 18:35:22 +0200
committerNiels Martin Hansen <nielsm@indvikleren.dk>2018-09-03 21:57:04 +0200
commit560b01f3071664357c2608c031bb8a4f86caaf26 (patch)
tree951ef2e6cf1ae4278a49a4f96f26a402f450a374 /src
parent4b0b4e06435b76e1cb40a8a65ccdc2307d48081d (diff)
downloadopenttd-560b01f3071664357c2608c031bb8a4f86caaf26.tar.xz
Fix: Check the search paths for standard MIDI files
Diffstat (limited to 'src')
-rw-r--r--src/music/midifile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/music/midifile.cpp b/src/music/midifile.cpp
index 688538db9..9506776ef 100644
--- a/src/music/midifile.cpp
+++ b/src/music/midifile.cpp
@@ -1010,7 +1010,12 @@ bool MidiFile::WriteSMF(const char *filename)
std::string MidiFile::GetSMFFile(const MusicSongInfo &song)
{
if (song.filetype == MTT_STANDARDMIDI) {
- return std::string(song.filename);
+ char filename[MAX_PATH];
+ if (FioFindFullPath(filename, lastof(filename), Subdirectory::BASESET_DIR, song.filename)) {
+ return std::string(filename);
+ } else {
+ return std::string();
+ }
}
if (song.filetype != MTT_MPSMIDI) return std::string();