Merge branch 'master' into jgrpp
# Conflicts: # os/macosx/notarize.sh # src/3rdparty/CMakeLists.txt # src/3rdparty/squirrel/squirrel/sqcompiler.cpp # src/3rdparty/squirrel/squirrel/sqdebug.cpp # src/3rdparty/squirrel/squirrel/sqvm.cpp # src/console_cmds.cpp # src/core/span_type.hpp # src/crashlog.cpp # src/currency.h # src/date_gui.cpp # src/driver.cpp # src/fios.cpp # src/genworld_gui.cpp # src/hotkeys.cpp # src/misc_gui.cpp # src/music/os2_m.cpp # src/network/core/os_abstraction.h # src/network/network_server.cpp # src/newgrf.cpp # src/newgrf_config.h # src/newgrf_text.cpp # src/openttd.cpp # src/os/macosx/font_osx.cpp # src/os/macosx/misc_osx.cpp # src/os/os2/CMakeLists.txt # src/os/os2/os2.cpp # src/os/unix/CMakeLists.txt # src/os/windows/font_win32.cpp # src/os/windows/win32_main.cpp # src/saveload/saveload.cpp # src/script/api/script_text.cpp # src/settings.cpp # src/settings_gui.cpp # src/stdafx.h # src/strings.cpp # src/timetable_gui.cpp # src/town_gui.cpp # src/train_cmd.cpp # src/video/dedicated_v.cpp # src/video/video_driver.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/waypoint_gui.cpp # src/widgets/dropdown_type.h # src/window.cpp # src/window_gui.h
This commit is contained in:
@@ -22,7 +22,7 @@ extern void CheckExternalFiles();
|
||||
* @param name the name of the item to fetch.
|
||||
*/
|
||||
#define fetch_metadata(name) \
|
||||
item = metadata->GetItem(name, false); \
|
||||
item = metadata->GetItem(name); \
|
||||
if (item == nullptr || !item->value.has_value() || item->value->empty()) { \
|
||||
DEBUG(grf, 0, "Base " SET_TYPE "set detail loading: %s field missing.", name); \
|
||||
DEBUG(grf, 0, " Is %s readable for the user running OpenTTD?", full_filename.c_str()); \
|
||||
@@ -64,7 +64,7 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
fetch_metadata("version");
|
||||
this->version = atoi(item->value->c_str());
|
||||
|
||||
item = metadata->GetItem("fallback", false);
|
||||
item = metadata->GetItem("fallback");
|
||||
this->fallback = (item != nullptr && item->value && *item->value != "0" && *item->value != "false");
|
||||
|
||||
/* For each of the file types we want to find the file, MD5 checksums and warning messages. */
|
||||
@@ -74,7 +74,7 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
for (uint i = 0; i < Tnum_files; i++) {
|
||||
MD5File *file = &this->files[i];
|
||||
/* Find the filename first. */
|
||||
item = files->GetItem(BaseSet<T, Tnum_files, Tsearch_in_tars>::file_names[i], false);
|
||||
item = files->GetItem(BaseSet<T, Tnum_files, Tsearch_in_tars>::file_names[i]);
|
||||
if (item == nullptr || (!item->value.has_value() && !allow_empty_filename)) {
|
||||
DEBUG(grf, 0, "No " SET_TYPE " file for: %s (in %s)", BaseSet<T, Tnum_files, Tsearch_in_tars>::file_names[i], full_filename.c_str());
|
||||
return false;
|
||||
@@ -92,7 +92,7 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
file->filename = path + filename;
|
||||
|
||||
/* Then find the MD5 checksum */
|
||||
item = md5s->GetItem(filename, false);
|
||||
item = md5s->GetItem(filename);
|
||||
if (item == nullptr || !item->value.has_value()) {
|
||||
DEBUG(grf, 0, "No MD5 checksum specified for: %s (in %s)", filename.c_str(), full_filename.c_str());
|
||||
return false;
|
||||
@@ -118,8 +118,8 @@ bool BaseSet<T, Tnum_files, Tsearch_in_tars>::FillSetDetails(IniFile *ini, const
|
||||
}
|
||||
|
||||
/* Then find the warning message when the file's missing */
|
||||
item = origin->GetItem(filename, false);
|
||||
if (item == nullptr) item = origin->GetItem("default", false);
|
||||
item = origin->GetItem(filename);
|
||||
if (item == nullptr) item = origin->GetItem("default");
|
||||
if (item == nullptr || !item->value.has_value()) {
|
||||
DEBUG(grf, 1, "No origin warning message specified for: %s", filename.c_str());
|
||||
file->missing_warning.clear();
|
||||
|
Reference in New Issue
Block a user