mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-23 04:04:09 +01:00
Codechange: Replace atoi and atoll with ParseInteger.
This commit is contained in:
@@ -134,7 +134,12 @@ bool MusicSet::FillSetDetails(const IniFile &ini, const std::string &path, const
|
||||
if (item != nullptr && item->value.has_value() && !item->value->empty()) {
|
||||
/* Song has a CAT file index, assume it's MPS MIDI format */
|
||||
this->songinfo[i].filetype = MTT_MPSMIDI;
|
||||
this->songinfo[i].cat_index = atoi(item->value->c_str());
|
||||
auto value = ParseInteger(*item->value);
|
||||
if (!value.has_value()) {
|
||||
Debug(grf, 0, "Invalid base music set song index: {}/{}", filename, *item->value);
|
||||
continue;
|
||||
}
|
||||
this->songinfo[i].cat_index = *value;
|
||||
auto songname = GetMusicCatEntryName(filename, this->songinfo[i].cat_index);
|
||||
if (!songname.has_value()) {
|
||||
Debug(grf, 0, "Base music set song missing from CAT file: {}/{}", filename, this->songinfo[i].cat_index);
|
||||
|
||||
Reference in New Issue
Block a user