From 1b3e8a02185752d3f6d6ccbe917abe5535b36ad0 Mon Sep 17 00:00:00 2001 From: marder Date: Wed, 28 Feb 2024 06:44:09 +0000 Subject: [PATCH] Fix wrong default in "scaleByMapArea" Noticed and patch proposed by @Feldfeld in 480228f964 Doesn't have any consequences as the function is only called via "scaleByMapAreaAbsolute" in the codebase. accepted by @Feldfeld @marder Differential revision: https://code.wildfiregames.com/D5248 This was SVN commit r28042. --- binaries/data/mods/public/maps/random/rmgen/library.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/binaries/data/mods/public/maps/random/rmgen/library.js b/binaries/data/mods/public/maps/random/rmgen/library.js index b131e20273..20c8c6e7b9 100644 --- a/binaries/data/mods/public/maps/random/rmgen/library.js +++ b/binaries/data/mods/public/maps/random/rmgen/library.js @@ -84,7 +84,7 @@ function scaleByMapSize(min, max, minMapSize = 128, maxMapSize = 512) * Interpolate quadratic between (min, minMapArea) and (max, maxMapArea) with respect to the mapSize. * Default values set on the area of tiny and giant map sizes according to the map shape (square or circular). */ -function scaleByMapArea(min, max, minMapArea = g_Map.getArea(128), maxMapArea = g_Map.getArea(256)) +function scaleByMapArea(min, max, minMapArea = g_Map.getArea(128), maxMapArea = g_Map.getArea(512)) { return min + (max - min) * (g_Map.getArea() - minMapArea) / (maxMapArea - minMapArea); } @@ -165,7 +165,7 @@ function createAreasInAreas(centeredPlacer, painter, constraints, amount, retryF log("createAreasInAreas: 'areas' was either empty or only contained empty areas thus returning an empty array.\n" + new Error().stack); return []; } - + const placeFunc = function() { centeredPlacer.setCenterPosition(pickRandom(pickRandom(areas).getPoints())); return createArea(centeredPlacer, painter, constraints); @@ -199,7 +199,7 @@ function createObjectGroupsByAreas(group, player, constraints, amount, retryFact log("createObjectGroupsByAreas: 'areas' was either empty or only contained empty areas.\n" + new Error().stack); return []; } - + const placeFunc = function() { group.setCenterPosition(pickRandom(pickRandom(areas).getPoints())); return createObjectGroup(group, player, constraints);