From 0b7f5f5cffd6019567ab78c4e037481a94505bf5 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Mon, 22 Jul 2019 21:20:03 +0300 Subject: [PATCH] Resolved #954 - settlers can't settle cities inside other civ's territory LibGDX, Kotlin and Gradle upgrade --- build.gradle | 6 +++--- .../com/unciv/logic/automation/SpecificUnitAutomation.kt | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index e5690bac0b..bc122ac7cb 100644 --- a/build.gradle +++ b/build.gradle @@ -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' diff --git a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt index dd5bd0ac21..541cf7bee9 100644 --- a/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt +++ b/core/src/com/unciv/logic/automation/SpecificUnitAutomation.kt @@ -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()