diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index 47469cbea5..cf25ac0543 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -29,6 +29,7 @@ import com.unciv.logic.civilization.managers.TurnManager import com.unciv.logic.civilization.managers.VictoryManager import com.unciv.logic.github.Github.repoNameToFolderName import com.unciv.logic.map.CityDistanceData +import com.unciv.logic.map.MapShape import com.unciv.logic.map.TileMap import com.unciv.logic.map.tile.Tile import com.unciv.models.Religion @@ -652,6 +653,18 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion tileMap.setTransients(ruleset) + // Temporary - All games saved in 4.12.15 turned into 'hexagonal non world wrapped' + // Here we attempt to fix that + + // How do we recognize a rectangle? By having many tiles at the lowest edge + val tilesWithLowestRow = tileMap.tileList.groupBy { it.getRow() }.minBy { it.key }.value + if (tilesWithLowestRow.size > 2) tileMap.mapParameters.shape = MapShape.rectangular + + // Set all to worldwrap if we have a good number of columns for it + // TODO REMOVE THIS SOON since this means default rectangle maps are world-wrap-ified! + val columns = tileMap.tileList.groupBy { it.getColumn() }.size + tileMap.mapParameters.worldWrap = columns % 2 == 0 + if (currentPlayer == "") currentPlayer = if (gameParameters.isOnlineMultiplayer) civilizations.first { it.isHuman() && !it.isSpectator() }.civName // For MP, spectator doesn't get a 'turn' else civilizations.first { it.isHuman() }.civName // for non-MP games, you can be a spectator of an AI-only match, and you *do* get a turn, sort of diff --git a/core/src/com/unciv/logic/map/MapParameters.kt b/core/src/com/unciv/logic/map/MapParameters.kt index 2440520e2d..cb2bce6de0 100644 --- a/core/src/com/unciv/logic/map/MapParameters.kt +++ b/core/src/com/unciv/logic/map/MapParameters.kt @@ -41,11 +41,13 @@ object MapType { class MapParameters : IsPartOfGameInfoSerialization { var name = "" var type = MapType.pangaea + // DO NOT CHANGE DEFAULTS since that changes all existing games to new default! var shape = MapShape.hexagonal var mapSize = MapSize.Medium var mapResources = MapResourceSetting.default.label var noRuins = false var noNaturalWonders = false + // DO NOT CHANGE DEFAULTS since that changes all existing games to new default! var worldWrap = false var strategicBalance = false var legendaryStart = false