mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-24 12:05:54 -04:00
Sleeping units wake if there's an enemy in 3-tile radius
This commit is contained in:
parent
6964c66d73
commit
cba5ab0b91
@ -878,8 +878,7 @@ class MapUnit : IsPartOfGameInfoSerialization {
|
|||||||
// For every double-stacked tile, check if our cohabitant can boost our speed
|
// For every double-stacked tile, check if our cohabitant can boost our speed
|
||||||
for (unit in getTile().getUnits())
|
for (unit in getTile().getUnits())
|
||||||
{
|
{
|
||||||
if (unit == this)
|
if (unit == this) continue
|
||||||
continue
|
|
||||||
|
|
||||||
if (unit.getMatchingUniques(UniqueType.TransferMovement)
|
if (unit.getMatchingUniques(UniqueType.TransferMovement)
|
||||||
.any { matchesFilter(it.params[0]) } )
|
.any { matchesFilter(it.params[0]) } )
|
||||||
@ -890,8 +889,8 @@ class MapUnit : IsPartOfGameInfoSerialization {
|
|||||||
// Wake sleeping units if there's an enemy in vision range:
|
// Wake sleeping units if there's an enemy in vision range:
|
||||||
// Military units always but civilians only if not protected.
|
// Military units always but civilians only if not protected.
|
||||||
if (isSleeping() && (isMilitary() || (currentTile.militaryUnit == null && !currentTile.isCityCenter())) &&
|
if (isSleeping() && (isMilitary() || (currentTile.militaryUnit == null && !currentTile.isCityCenter())) &&
|
||||||
this.viewableTiles.any {
|
this.currentTile.getTilesInDistance(3).any {
|
||||||
it.militaryUnit != null && it.militaryUnit!!.civInfo.isAtWarWith(civInfo)
|
it.militaryUnit != null && it in civInfo.viewableTiles && it.militaryUnit!!.civInfo.isAtWarWith(civInfo)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
action = null
|
action = null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user