Silly roadbuilding crash bugfix

This commit is contained in:
Yair Morgenstern 2018-11-06 20:26:31 +02:00
parent c8285b9b0a
commit f73d840a9d
3 changed files with 5 additions and 5 deletions

View file

@ -568,7 +568,7 @@
isWonder:true,
percentStatBonus:{culture:50},
uniques:["Free Social Policy","Can only be built in coastal cities"],
requiredTech:"Flight"
requiredTech:"Ecology"
},
{
name:"Spaceship Factory",

View file

@ -21,8 +21,8 @@ android {
applicationId "com.unciv.game"
minSdkVersion 14
targetSdkVersion 26
versionCode 155
versionName "2.9.8"
versionCode 157
versionName "2.9.9"
}
buildTypes {
release {

View file

@ -71,9 +71,9 @@ class WorkerAutomation(val unit: MapUnit) {
else{
val reachableTiles = roadableTiles.filter { unit.canMoveTo(it)&& unit.movementAlgs().canReach(it)}
if(!reachableTiles.any()) continue
tileToConstructRoadOn = roadableTiles.minBy { unit.movementAlgs().getShortestPath(it).size }!!
tileToConstructRoadOn = reachableTiles.minBy { unit.movementAlgs().getShortestPath(it).size }!!
unit.movementAlgs().headTowards(tileToConstructRoadOn)
}
unit.movementAlgs().headTowards(tileToConstructRoadOn)
if(unit.currentMovement>0 && unit.currentTile==tileToConstructRoadOn
&& unit.currentTile.improvementInProgress!="Road")
tileToConstructRoadOn.startWorkingOnImprovement(GameBasics.TileImprovements["Road"]!!,unit.civInfo)