Techs from ancient ruins now added properly

This commit is contained in:
Yair Morgenstern 2019-02-17 00:01:54 +02:00
parent 4c5753c41f
commit dd63491c03
4 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -70,7 +70,7 @@ class CivilizationInfo {
constructor(civName: String) {
this.civName = civName
tech.techsResearched.add("Agriculture")
tech.addTechnology("Agriculture")
}
fun clone(): CivilizationInfo {

View File

@ -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)
}

View File

@ -82,7 +82,6 @@ class LoadScreen : PickerScreen() {
UnCivGame.Current.loadGame(selectedSave)
}
}
}