mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 10:18:26 +07:00
Resolved #1230 - sleeping units wake up if there's an enemy nearby
This commit is contained in:
@ -384,6 +384,13 @@ class MapUnit {
|
|||||||
currentMovement = getMaxMovement().toFloat()
|
currentMovement = getMaxMovement().toFloat()
|
||||||
attacksThisTurn=0
|
attacksThisTurn=0
|
||||||
due = true
|
due = true
|
||||||
|
|
||||||
|
// Wake sleeping units if there's an enemy nearby
|
||||||
|
if(action==Constants.unitActionSleep && currentTile.getTilesInDistance(2).any {
|
||||||
|
it.militaryUnit!=null && it.militaryUnit!!.civInfo.isAtWarWith(civInfo)
|
||||||
|
})
|
||||||
|
action=null
|
||||||
|
|
||||||
val tileOwner = getTile().getOwner()
|
val tileOwner = getTile().getOwner()
|
||||||
if(tileOwner!=null && !civInfo.canEnterTiles(tileOwner) && !tileOwner.isCityState()) // if an enemy city expanded onto this tile while I was in it
|
if(tileOwner!=null && !civInfo.canEnterTiles(tileOwner) && !tileOwner.isCityState()) // if an enemy city expanded onto this tile while I was in it
|
||||||
movement.teleportToClosestMoveableTile()
|
movement.teleportToClosestMoveableTile()
|
||||||
|
Reference in New Issue
Block a user