Stop AI puppets from building settlers and military (#7129)

* Stop puppeted cities from building settlers and military

* Move puppet check to function
This commit is contained in:
OptimizedForDensity
2022-06-11 15:14:24 -04:00
committed by GitHub
parent d34fa7db3d
commit 72b197fdc3
2 changed files with 2 additions and 1 deletions

View File

@ -106,6 +106,7 @@ object Automation {
}
fun tryTrainMilitaryUnit(city: CityInfo) {
if (city.isPuppet) return
val chosenUnitName = chooseMilitaryUnit(city)
if (chosenUnitName != null)
city.cityConstructions.currentConstructionFromQueue = chosenUnitName

View File

@ -878,7 +878,7 @@ object NextTurnAutomation {
currentConstruction is BaseUnit && currentConstruction.hasUnique(UniqueType.FoundCity)
}) {
val bestCity = civInfo.cities.maxByOrNull { it.cityStats.currentCityStats.production }!!
val bestCity = civInfo.cities.filterNot { it.isPuppet }.maxByOrNull { it.cityStats.currentCityStats.production }!!
if (bestCity.cityConstructions.builtBuildings.size > 1) // 2 buildings or more, otherwise focus on self first
bestCity.cityConstructions.currentConstructionFromQueue = settlerUnits.minByOrNull { it.cost }!!.name
}