3.8.12-patch1

Added case where worker that needs to ru away has nowhere to move to
This commit is contained in:
Yair Morgenstern 2020-05-26 16:35:01 +03:00
parent 1f7d9ead20
commit 8e9cd174dc
2 changed files with 4 additions and 3 deletions

View File

@ -3,8 +3,8 @@ package com.unciv.build
object BuildConfig {
const val kotlinVersion = "1.3.71"
const val appName = "Unciv"
const val appCodeNumber = 431
const val appVersion = "3.8.12"
const val appCodeNumber = 432
const val appVersion = "3.8.12-patch1"
const val gdxVersion = "1.9.10"
const val roboVMVersion = "2.3.1"

View File

@ -77,7 +77,8 @@ class WorkerAutomation(val unit: MapUnit) {
return
}
val tileFurthestFromEnemy = reachableTiles.keys.filter { unit.movement.canMoveTo(it) }
.maxBy(this::countDistanceToClosestEnemy)!!
.maxBy(this::countDistanceToClosestEnemy)
if(tileFurthestFromEnemy==null) return // can't move anywhere!
unit.movement.moveToTile(tileFurthestFromEnemy)
}