Skip to content

Commit

Permalink
....and toggle it off during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Mar 4, 2024
1 parent ccd52b8 commit 57d79da
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions data/mods/TEST_DATA/game_balance.json
Original file line number Diff line number Diff line change
@@ -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
}
]
4 changes: 4 additions & 0 deletions tests/overmap_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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<bool>( "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
Expand Down

0 comments on commit 57d79da

Please sign in to comment.