1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Settings: Proper priority hierarchy

Remove old defaults system
Introduce priority-based fallback list
Use new functions for map_meta special functions
Change groups to use end tags

Unittest changes:
 * Adapt unittest to the new code
 * Compare Settings objects
This commit is contained in:
SmallJoker 2020-11-22 17:49:30 +01:00 committed by sfan5
parent 5e9dd1667b
commit 37a05ec8d6
21 changed files with 358 additions and 298 deletions

View file

@ -487,12 +487,15 @@ static bool create_userdata_path()
static bool init_common(const Settings &cmd_args, int argc, char *argv[])
{
startup_message();
set_default_settings(g_settings);
set_default_settings();
// Initialize sockets
sockets_init();
atexit(sockets_cleanup);
// Initialize g_settings
Settings::createLayer(SL_GLOBAL);
if (!read_config_file(cmd_args))
return false;
@ -524,6 +527,7 @@ static bool read_config_file(const Settings &cmd_args)
// Path of configuration file in use
sanity_check(g_settings_path == ""); // Sanity check
if (cmd_args.exists("config")) {
bool r = g_settings->readConfigFile(cmd_args.get("config").c_str());
if (!r) {