Fixed replacing obsolete units for new queue

This commit is contained in:
Yair Morgenstern 2020-04-18 21:10:39 +03:00
parent 6635ed5be9
commit 1b4cd9c3b3

View file

@ -260,7 +260,7 @@ class TechManager {
for (city in civInfo.cities)
for(constructionName in city.cityConstructions.constructionQueue.toList()){ // copy, since we're changing the queue
if(constructionName !in obsoleteUnits) continue
val constructionUnit = city.cityConstructions.getCurrentConstruction() as BaseUnit
val constructionUnit = city.cityConstructions.getConstruction(constructionName) as BaseUnit
city.cityConstructions.constructionQueue.replaceAll { if(it==constructionName) constructionUnit.upgradesTo!! else it }
}