Fix automated units not auto upgrading when enabled in options (#13434)

* fix automated ranged units not heading to enemy city

* fix distance from city typo

* Address points made in PR

* priotirize tiles without retaliation

* remove dangerous tiles logic

* resolve review with alternative approach

* faster exit if no sight

* automated units auto upgrade if enabled

* simplified condition
This commit is contained in:
metablaster 2025-06-15 10:23:48 +02:00 committed by GitHub
parent af377058ba
commit a35de18455
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -196,6 +196,9 @@ object UnitAutomation {
unit.promotions.addPromotion(chosenPromotion.name)
}
// AI upgrades units via UseGoldAutomation in NextTurnAutomation
if (unit.civ.isHuman() && tryUpgradeUnit(unit)) return
//This allows for military units with certain civilian abilities to behave as civilians in peace and soldiers in war
if ((unit.hasUnique(UniqueType.BuildImprovements) || unit.hasUnique(UniqueType.FoundCity) ||