From 1ff1ada25c9c9fb167a82f1a2fd0f73329fcdb62 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Wed, 24 Feb 2021 20:05:35 -0500 Subject: [PATCH] Don't refresh addon cache if running without addons This allows WML unit tests to be successfully run locally even if you have a local addon that does not have an _info.cfg or _server.pbl. --- src/wesnoth.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wesnoth.cpp b/src/wesnoth.cpp index d591ccfb8e16..75dfe30e8567 100644 --- a/src/wesnoth.cpp +++ b/src/wesnoth.cpp @@ -771,7 +771,7 @@ static int do_gameloop(const std::vector& args) game_config_manager config_manager(cmdline_opts); - gui2::dialogs::loading_screen::display([&res, &config_manager]() { + gui2::dialogs::loading_screen::display([&res, &config_manager, &cmdline_opts]() { gui2::dialogs::loading_screen::progress(loading_stage::load_config); res = config_manager.init_game_config(game_config_manager::NO_FORCE_RELOAD); @@ -788,9 +788,11 @@ static int do_gameloop(const std::vector& args) return; } - gui2::dialogs::loading_screen::progress(loading_stage::refresh_addons); + if(!game_config::no_addons && !cmdline_opts.noaddons) { + gui2::dialogs::loading_screen::progress(loading_stage::refresh_addons); - refresh_addon_version_info_cache(); + refresh_addon_version_info_cache(); + } }); if(res == false) {