mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-18 11:49:19 +07:00
Don't allow AI to offer peace to cty states allied with their enemies
This commit is contained in:
@ -311,14 +311,6 @@ class GameInfo {
|
||||
for (cityInfo in civInfo.cities) cityInfo.cityStats.updateCityHappiness()
|
||||
|
||||
for (cityInfo in civInfo.cities) {
|
||||
if (cityInfo.cityConstructions.currentConstruction != "") { // move it to the top of the queue
|
||||
val constructionQueue = cityInfo.cityConstructions.constructionQueue
|
||||
val itemsInQueue = constructionQueue.toList()
|
||||
constructionQueue.clear()
|
||||
constructionQueue.add(cityInfo.cityConstructions.currentConstruction)
|
||||
constructionQueue.addAll(itemsInQueue)
|
||||
cityInfo.cityConstructions.currentConstruction = ""
|
||||
}
|
||||
|
||||
// As of 3.10.14, specialists are saved by name not by stat
|
||||
for((key, value) in cityInfo.population.specialists.toHashMap().filter { it.value>0 })
|
||||
|
@ -305,6 +305,8 @@ object NextTurnAutomation {
|
||||
.map { it.value.otherCiv() }
|
||||
.filterNot { it == civInfo || it.isBarbarian() || it.cities.isEmpty() }
|
||||
.filter { !civInfo.getDiplomacyManager(it).hasFlag(DiplomacyFlags.DeclinedPeace) }
|
||||
// Don't allow AIs to offer peace to ity states allied with their enemies
|
||||
.filterNot { it.isCityState() && it.getAllyCiv()!="" && civInfo.isAtWarWith(civInfo.gameInfo.getCivilization(it.getAllyCiv())) }
|
||||
|
||||
for (enemy in enemiesCiv) {
|
||||
val enemiesStrength = Automation.evaluteCombatStrength(enemy)
|
||||
|
@ -34,8 +34,6 @@ class CityConstructions {
|
||||
|
||||
var builtBuildings = HashSet<String>()
|
||||
val inProgressConstructions = HashMap<String, Int>()
|
||||
@Deprecated("As of 3.7.5, all constructions are in the queue")
|
||||
var currentConstruction=""
|
||||
var currentConstructionFromQueue: String
|
||||
get() {
|
||||
if(constructionQueue.isEmpty()) return "" else return constructionQueue.first()
|
||||
|
Reference in New Issue
Block a user