diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index e31b37b895..d1c26eea12 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -92,6 +92,8 @@ class GameInfo { tile = viableTiles.getRandom() } + // if we don't make this into a separate list then the retain() will happen on the Tech keys, + // which effectively removes those techs from the game and causes all sorts of problems val allResearchedTechs = GameBasics.Technologies.keys.toMutableList() for (civ in civilizations.filter { !it.isBarbarianCivilization() && !it.isDefeated() }) { allResearchedTechs.retainAll(civ.tech.techsResearched) diff --git a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt index 5019155442..13ef8686f2 100644 --- a/core/src/com/unciv/logic/civilization/CivilizationInfo.kt +++ b/core/src/com/unciv/logic/civilization/CivilizationInfo.kt @@ -70,7 +70,7 @@ class CivilizationInfo { constructor(civName: String) { this.civName = civName - tech.techsResearched.add("Agriculture") + tech.addTechnology("Agriculture") } fun clone(): CivilizationInfo { diff --git a/core/src/com/unciv/logic/map/MapUnit.kt b/core/src/com/unciv/logic/map/MapUnit.kt index d683060012..fcbf6d34b9 100644 --- a/core/src/com/unciv/logic/map/MapUnit.kt +++ b/core/src/com/unciv/logic/map/MapUnit.kt @@ -416,8 +416,7 @@ class MapUnit { if(researchableAncientEraTechs.isNotEmpty()) actions.add { val tech = researchableAncientEraTechs.getRandom().name - civInfo.tech.techsResearched.add(tech) - if(civInfo.tech.techsToResearch.contains(tech)) civInfo.tech.techsToResearch.remove(tech) + civInfo.tech.addTechnology(tech) civInfo.addNotification("We have discovered the lost technology of [$tech] in the ruins!",currentTile.position, Color.BLUE) } diff --git a/core/src/com/unciv/ui/saves/LoadScreen.kt b/core/src/com/unciv/ui/saves/LoadScreen.kt index 8e1c15e729..febf54bc9a 100644 --- a/core/src/com/unciv/ui/saves/LoadScreen.kt +++ b/core/src/com/unciv/ui/saves/LoadScreen.kt @@ -82,7 +82,6 @@ class LoadScreen : PickerScreen() { UnCivGame.Current.loadGame(selectedSave) } - } } \ No newline at end of file