mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-23 03:23:17 -04:00
Battletable only displays combat if the enemy unit is viewable or if the enemy ciity's tile has been explored
This commit is contained in:
parent
a72c1c7d95
commit
d8a5acb6f2
@ -26,10 +26,11 @@ class BattleTable(val worldScreen: WorldScreen): Table() {
|
|||||||
if (worldScreen.tileMapHolder.selectedTile == null) return
|
if (worldScreen.tileMapHolder.selectedTile == null) return
|
||||||
val selectedTile = worldScreen.tileMapHolder.selectedTile!!
|
val selectedTile = worldScreen.tileMapHolder.selectedTile!!
|
||||||
val defender: ICombatant
|
val defender: ICombatant
|
||||||
if(selectedTile.isCityCenter && selectedTile.getOwner() != worldScreen.civInfo)
|
if (selectedTile.explored && selectedTile.isCityCenter && selectedTile.getOwner() != worldScreen.civInfo)
|
||||||
defender = CityCombatant(selectedTile.city!!)
|
defender = CityCombatant(selectedTile.city!!)
|
||||||
else if (selectedTile.unit != null
|
else if (selectedTile.unit != null
|
||||||
&& selectedTile.unit!!.owner != worldScreen.civInfo.civName) // enemy unit on selected tile,
|
&& selectedTile.unit!!.owner != worldScreen.civInfo.civName // enemy unit on selected tile,
|
||||||
|
&& worldScreen.civInfo.getViewableTiles().contains(selectedTile))
|
||||||
defender = MapUnitCombatant(selectedTile.unit!!)
|
defender = MapUnitCombatant(selectedTile.unit!!)
|
||||||
else {
|
else {
|
||||||
clear()
|
clear()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user