mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-04 23:40:01 +07:00
Fixed a rare bug where unit would try to "walk" to a conquered city even though it was already in it
This commit is contained in:
@ -164,7 +164,7 @@ class Battle(val gameInfo:GameInfo=UnCivGame.Current.gameInfo) {
|
||||
conquerCity((defender as CityCombatant).city, attacker)
|
||||
}
|
||||
|
||||
if (attacker.isMelee() && (defender.isDefeated() || defender.getCivilization()==attacker.getCivilization() )) {
|
||||
else if (attacker.isMelee() && (defender.isDefeated() || defender.getCivilization()==attacker.getCivilization() )) {
|
||||
if(attackedTile.civilianUnit!=null)
|
||||
captureCivilianUnit(attacker,MapUnitCombatant(attackedTile.civilianUnit!!))
|
||||
(attacker as MapUnitCombatant).unit.moveToTile(attackedTile)
|
||||
|
@ -90,6 +90,7 @@ class MapUnit {
|
||||
}
|
||||
|
||||
fun moveToTile(otherTile: TileInfo) {
|
||||
if(otherTile==getTile()) return // already here!
|
||||
val distanceToTiles = getDistanceToTiles()
|
||||
if (!distanceToTiles.containsKey(otherTile))
|
||||
throw Exception("You can't get there from here!")
|
||||
|
Reference in New Issue
Block a user