diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-09-03 18:35:22 +0200 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-09-03 21:57:04 +0200 |
commit | 560b01f3071664357c2608c031bb8a4f86caaf26 (patch) | |
tree | 951ef2e6cf1ae4278a49a4f96f26a402f450a374 | |
parent | 4b0b4e06435b76e1cb40a8a65ccdc2307d48081d (diff) | |
download | openttd-560b01f3071664357c2608c031bb8a4f86caaf26.tar.xz |
Fix: Check the search paths for standard MIDI files
-rw-r--r-- | src/music/midifile.cpp | 7 |
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(); |