mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Fix Issue where cityState Could settle with CanFoundPuppetCity unique
This commit is contained in:
parent
62eadc90d2
commit
ceb4d22242
@ -511,10 +511,12 @@ object NextTurnAutomation {
|
|||||||
if (civInfo.isAtWar()) return // don't train settlers when you could be training troops.
|
if (civInfo.isAtWar()) return // don't train settlers when you could be training troops.
|
||||||
if (civInfo.cities.none()) return
|
if (civInfo.cities.none()) return
|
||||||
if (civInfo.getHappiness() <= civInfo.cities.size) 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
|
// 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 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 {
|
if (civInfo.cities.any {
|
||||||
val currentConstruction = it.cityConstructions.getCurrentConstruction()
|
val currentConstruction = it.cityConstructions.getCurrentConstruction()
|
||||||
currentConstruction is BaseUnit && currentConstruction.isCityFounder()
|
currentConstruction is BaseUnit && currentConstruction.isCityFounder()
|
||||||
|
@ -32,7 +32,12 @@ object CivilianUnitAutomation {
|
|||||||
.any { canUse(unit, it) }
|
.any { canUse(unit, it) }
|
||||||
|
|
||||||
val hasSettlerUnique = hasSettlerAction(UniqueType.FoundCity) || hasSettlerAction(UniqueType.FoundPuppetCity)
|
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)
|
return SpecificUnitAutomation.automateSettlerActions(unit, dangerousTiles)
|
||||||
|
|
||||||
if (tryRunAwayIfNeccessary(unit)) return
|
if (tryRunAwayIfNeccessary(unit)) return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user