Merge branch 'master' into jgrpp
# Conflicts: # src/music.cpp # src/script/api/script_company.cpp # src/script/api/script_event_types.cpp # src/script/api/script_group.cpp # src/script/api/script_object.cpp # src/script/api/script_road.cpp
This commit is contained in:
@@ -128,7 +128,6 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
||||
for (uint i = 0; i < lengthof(this->songinfo); i++) {
|
||||
const char *filename = this->files[i].filename;
|
||||
if (names == nullptr || StrEmpty(filename) || this->files[i].check_result == MD5File::CR_NO_FILE) {
|
||||
this->songinfo[i].songname[0] = '\0';
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -141,11 +140,10 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
||||
this->songinfo[i].cat_index = atoi(item->value->c_str());
|
||||
char *songname = GetMusicCatEntryName(filename, this->songinfo[i].cat_index);
|
||||
if (songname == nullptr) {
|
||||
DEBUG(grf, 1, "Base music set song missing from CAT file: %s/%d", filename, this->songinfo[i].cat_index);
|
||||
this->songinfo[i].songname[0] = '\0';
|
||||
DEBUG(grf, 0, "Base music set song missing from CAT file: %s/%d", filename, this->songinfo[i].cat_index);
|
||||
continue;
|
||||
}
|
||||
strecpy(this->songinfo[i].songname, songname, lastof(this->songinfo[i].songname));
|
||||
this->songinfo[i].songname = songname;
|
||||
free(songname);
|
||||
} else {
|
||||
this->songinfo[i].filetype = MTT_STANDARDMIDI;
|
||||
@@ -166,7 +164,7 @@ bool MusicSet::FillSetDetails(IniFile *ini, const char *path, const char *full_f
|
||||
|
||||
if (this->songinfo[i].filetype == MTT_STANDARDMIDI) {
|
||||
if (item != nullptr && item->value.has_value() && !item->value->empty()) {
|
||||
strecpy(this->songinfo[i].songname, item->value->c_str(), lastof(this->songinfo[i].songname));
|
||||
this->songinfo[i].songname = item->value.value();
|
||||
} else {
|
||||
DEBUG(grf, 0, "Base music set song name missing: %s", filename);
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user