Fix Issue where cityState Could settle with CanFoundPuppetCity unique

This commit is contained in:
Emandac 2025-09-01 18:31:46 +02:00
parent 62eadc90d2
commit ceb4d22242
2 changed files with 9 additions and 2 deletions

View File

@ -511,10 +511,12 @@ object NextTurnAutomation {
if (civInfo.isAtWar()) return // don't train settlers when you could be training troops.
if (civInfo.cities.none()) return
if (civInfo.getHappiness() <= civInfo.cities.size) return
// This is a tough one - if we don't ignore conditionals we could have units that can found only on certain tiles that are ignored
// If we DO ignore conditionals we could get a unit that can only found if there's a certain tech, or something
if (civInfo.units.getCivUnits().any { it.hasUnique(UniqueType.FoundCity, GameContext.IgnoreConditionals) }) return
if (civInfo.units.getCivUnits().any { it.hasUnique(UniqueType.FoundCity, GameContext.IgnoreConditionals)}) return
if (civInfo.cities.any {
val currentConstruction = it.cityConstructions.getCurrentConstruction()
currentConstruction is BaseUnit && currentConstruction.isCityFounder()

View File

@ -32,7 +32,12 @@ object CivilianUnitAutomation {
.any { canUse(unit, it) }
val hasSettlerUnique = hasSettlerAction(UniqueType.FoundCity) || hasSettlerAction(UniqueType.FoundPuppetCity)
if (hasSettlerUnique)
/*
* allow citystate to build unit Military
* that can settle but stop them from settling that unit
*
* */
if (hasSettlerUnique && !(unit.civ.isCityState && unit.isMilitary()))
return SpecificUnitAutomation.automateSettlerActions(unit, dangerousTiles)
if (tryRunAwayIfNeccessary(unit)) return