Resolved #954 - settlers can't settle cities inside other civ's territory

LibGDX, Kotlin and Gradle upgrade
This commit is contained in:
Yair Morgenstern 2019-07-22 21:20:03 +03:00
parent 11d7ac714c
commit 0b7f5f5cff
2 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,6 @@
buildscript {
ext.kotlinVersion = '1.3.11'
ext.kotlinVersion = '1.3.41'
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
@ -16,7 +16,7 @@ buildscript {
}
dependencies {
classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.1'
}
}
@ -28,7 +28,7 @@ allprojects {
version = '1.0.1'
ext {
appName = "unciv-game"
gdxVersion = '1.9.9'
gdxVersion = '1.9.10'
roboVMVersion = '2.3.1'
box2DLightsVersion = '1.4'
ashleyVersion = '1.7.0'

View File

@ -100,7 +100,10 @@ class SpecificUnitAutomation{
.associateBy ( {it},{ Automation().rankTile(it,unit.civInfo) })
val possibleCityLocations = unit.getTile().getTilesInDistance(5)
.filter { (unit.movement.canMoveTo(it) || unit.currentTile==it) && it !in tilesNearCities && it.isLand }
.filter { val tileOwner=it.getOwner()
(tileOwner==null || tileOwner==unit.civInfo) && // don't allow settler to settle inside other civ's territory
(unit.movement.canMoveTo(it) || unit.currentTile==it)
&& it !in tilesNearCities && it.isLand }
val bestCityLocation: TileInfo? = possibleCityLocations
.asSequence()