From 3402065e3c1c381052f794be40f0973994ce3af6 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 12 Feb 2020 20:34:32 +0200 Subject: [PATCH] Captured Khans now automate properly --- core/src/com/unciv/logic/automation/NextTurnAutomation.kt | 3 ++- core/src/com/unciv/logic/automation/UnitAutomation.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index 1b70816007..bcab9d9413 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -447,7 +447,8 @@ class NextTurnAutomation{ when { unit.type.isRanged() -> rangedUnits.add(unit) unit.type.isMelee() -> meleeUnits.add(unit) - unit.name == civInfo.getEquivalentUnit(Constants.greatGeneral).name -> generals.add(unit) //generals move after military units + unit.name == Constants.greatGeneral || unit.baseUnit.replaces == Constants.greatGeneral + -> generals.add(unit) //generals move after military units else -> civilianUnits.add(unit) } } diff --git a/core/src/com/unciv/logic/automation/UnitAutomation.kt b/core/src/com/unciv/logic/automation/UnitAutomation.kt index ccd8bf2e4d..c6d867921d 100644 --- a/core/src/com/unciv/logic/automation/UnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/UnitAutomation.kt @@ -44,7 +44,7 @@ class UnitAutomation { return SpecificUnitAutomation().automateWorkBoats(unit) } - if (unit.name == unit.civInfo.getEquivalentUnit(Constants.greatGeneral).name) + if (unit.name == Constants.greatGeneral || unit.baseUnit.replaces == Constants.greatGeneral) return SpecificUnitAutomation().automateGreatGeneral(unit) if (unit.type == UnitType.Fighter)