mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
Settler automation takes into account which tiles already belong to other civs
This commit is contained in:
parent
b012fd0df8
commit
f605a0c00f
@ -103,6 +103,8 @@ object Automation {
|
|||||||
|
|
||||||
internal fun rankTile(tile: TileInfo?, civInfo: CivilizationInfo): Float {
|
internal fun rankTile(tile: TileInfo?, civInfo: CivilizationInfo): Float {
|
||||||
if (tile == null) return 0f
|
if (tile == null) return 0f
|
||||||
|
val tileOwner = tile.getOwner()
|
||||||
|
if (tileOwner != null && tileOwner != civInfo) return 0f // Already belongs to another civilization, useless to us
|
||||||
val stats = tile.getTileStats(null, civInfo)
|
val stats = tile.getTileStats(null, civInfo)
|
||||||
var rank = rankStatsValue(stats, civInfo)
|
var rank = rankStatsValue(stats, civInfo)
|
||||||
if (tile.improvement == null) rank += 0.5f // improvement potential!
|
if (tile.improvement == null) rank += 0.5f // improvement potential!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user