mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-22 02:42:16 -04:00
Select next idle unit only selects units belonging to the player
This commit is contained in:
parent
3ca20951e5
commit
a72c1c7d95
@ -11,7 +11,7 @@ import com.unciv.ui.worldscreen.WorldScreen
|
||||
class IdleUnitButton internal constructor(internal val worldScreen: WorldScreen) : TextButton("Select next idle unit", CameraStageBaseScreen.skin) {
|
||||
init {
|
||||
addClickListener {
|
||||
val tilesWithIdleUnits = worldScreen.civInfo.gameInfo.tileMap.values.filter { it.hasIdleUnit() }
|
||||
val tilesWithIdleUnits = worldScreen.civInfo.gameInfo.tileMap.values.filter { it.hasIdleUnit() && it.unit!!.owner == worldScreen.civInfo.civName }
|
||||
|
||||
val tileToSelect: TileInfo
|
||||
if (!tilesWithIdleUnits.contains(worldScreen.tileMapHolder.selectedTile))
|
||||
|
Loading…
x
Reference in New Issue
Block a user