From 57d79daaaa69f6564a334436b7b7b3253fbd7ac0 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:37:15 -0500 Subject: [PATCH] ....and toggle it off during tests --- data/mods/TEST_DATA/game_balance.json | 9 +++++++++ tests/overmap_test.cpp | 4 ++++ 2 files changed, 13 insertions(+) create mode 100644 data/mods/TEST_DATA/game_balance.json diff --git a/data/mods/TEST_DATA/game_balance.json b/data/mods/TEST_DATA/game_balance.json new file mode 100644 index 0000000000000..70bd35fc821ea --- /dev/null +++ b/data/mods/TEST_DATA/game_balance.json @@ -0,0 +1,9 @@ +[ + { + "type": "EXTERNAL_OPTION", + "name": "OVERMAP_GEOGRAPHY_CHANGE", + "info": "Controls whether or not density of forests and urban areas will be modified with distance from the 0,0 overmap. False disables this scaling completely.", + "stype": "bool", + "value": true + } +] diff --git a/tests/overmap_test.cpp b/tests/overmap_test.cpp index ab28d5fb78375..db1a105da6240 100644 --- a/tests/overmap_test.cpp +++ b/tests/overmap_test.cpp @@ -13,6 +13,7 @@ #include "map.h" #include "mapbuffer.h" #include "omdata.h" +#include "options.h" // #include "options_helpers.h" #include "output.h" #include "overmap.h" @@ -264,6 +265,9 @@ TEST_CASE( "overmap_terrain_coverage", "[overmap][slow]" ) point_abs_omt origin; map &main_map = get_map(); + // Geography scaling is disabled when the TEST_DATA mod is loaded, this test performs very poorly otherwise. + REQUIRE( get_option( "OVERMAP_GEOGRAPHY_CHANGE" ) ); + for( const point_abs_omt &p : closest_points_first( origin, 0, 10 * OMAPX - 1 ) ) { // We need to avoid OMTs that overlap with the 'main' map, so we start at a // non-zero minimum radius and ensure that the 'main' map is inside that