Skip to content

Commit 5bc93bb

Browse files
AmbecoMPD
andauthored
Jungles again no longer spawn on hills (#14580)
Specifically, new features must again able to occur on the LAST feature on the tile (or baseTerrain). This reproduces the old conditions, weird as they were. I also removed the hasVegitation from matches, better matching prior conditions. It only affected the case where the MapEditor generated vegetation, and then regenerated temperature, mountains or lakes, which is rare enough that keeping old behavior is safer. applyHumidityAndTemperature now again ignores hills and mountains, like it used to. Again, It only affected the case where the MapEditor generated elevation, and then regenerated temperature, which is rare enough that keeping old behavior is safer. Signed-off-by: MPD <mooing_psycho_duck@hotmail.com> Co-authored-by: MPD <mooing_psycho_duck@hotmail.com>
1 parent dcdfe88 commit 5bc93bb

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

core/src/com/unciv/logic/map/mapgenerator/MapGenerator.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class MapGenerator(val ruleset: Ruleset, private val coroutineScope: CoroutineSc
8989
tile.getBaseTerrain().type == TerrainType.Land
9090
&& tile.getBaseTerrain().hasUnique(UniqueType.OccursInChains) == occursInChains
9191
else
92-
terrain.occursOn.contains(tile.baseTerrain)
92+
terrain.occursOn.contains(tile.lastTerrain.name)
9393
}
9494

9595
/** Checks if both [temperature] and [humidity] satisfy their ranges (>From, <=To)
@@ -101,8 +101,7 @@ class MapGenerator(val ruleset: Ruleset, private val coroutineScope: CoroutineSc
101101
fun matches(tile: Tile, overrideTileTemp: Double) =
102102
tempFrom < overrideTileTemp && overrideTileTemp <= tempTo &&
103103
humidFrom < (tile.humidity ?: 0.0) && (tile.humidity?:0.0) <= humidTo &&
104-
matchesBaseTerrain(tile) &&
105-
tile.hasVegetation == hasVegitation
104+
matchesBaseTerrain(tile)
106105

107106
fun matchesIce() = terrain.type == TerrainType.TerrainFeature && terrain.impassable && terrain.occursOn.contains(Constants.ocean) && !rareFeature
108107

@@ -492,7 +491,7 @@ class MapGenerator(val ruleset: Ruleset, private val coroutineScope: CoroutineSc
492491
val noTerrainUniques = landTerrains.none { it.isConstrained}
493492

494493
for (tile in tileMap.values.asSequence()) {
495-
if (tile.isWater)
494+
if (tile.isWater || tile.baseTerrain in elevationTerrains)
496495
continue
497496

498497
val humidityRandom = randomness.getPerlinNoise(tile, humiditySeed, scale = scale, nOctaves = 1)
@@ -620,12 +619,12 @@ class MapGenerator(val ruleset: Ruleset, private val coroutineScope: CoroutineSc
620619
val vegetation = (randomness.getPerlinNoise(tile, vegetationSeed, scale = 3.0, nOctaves = 1) + 1.0) / 2.0
621620

622621
if (vegetation <= tileMap.mapParameters.vegetationRichness) {
623-
tile.hasVegetation = true
624622
val possibleVegetation = vegetationTerrains.filter { it.matches(tile)
625623
&& NaturalWonderGenerator.fitsTerrainUniques(it.terrain, tile)
626624
}
627625
if (possibleVegetation.isEmpty()) continue
628626
val randomVegetation = possibleVegetation.random(randomness.RNG)
627+
tile.hasVegetation = true
629628
tile.addTerrainFeature(randomVegetation.name)
630629
}
631630
}

0 commit comments

Comments
 (0)