Resolved #12279 - Units that can withdraw before melee do not do so when escorting civilian units

This commit is contained in:
yairm210
2024-10-13 16:30:37 +03:00
parent edad6d794b
commit d25a436391

View File

@ -639,6 +639,7 @@ object Battle {
private fun doWithdrawFromMeleeAbility(attacker: MapUnitCombatant, defender: MapUnitCombatant): Boolean {
if (defender.unit.isEmbarked()) return false
if (defender.unit.cache.cannotMove) return false
if (defender.unit.isEscorting()) return false // running away and leaving the escorted unit defeats the purpose of escorting
// Promotions have no effect as per what I could find in available documentation
val fromTile = defender.getTile()