mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-05 21:11:35 +07:00
Fixed bug where you could convince AI to declare war on defeated civs - kudos ninjatao!
This commit is contained in:
parent
8ec63f2e94
commit
cd28358289
@ -21,8 +21,8 @@ android {
|
||||
applicationId "com.unciv.game"
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 26
|
||||
versionCode 168
|
||||
versionName "2.10.7"
|
||||
versionCode 169
|
||||
versionName "2.10.8"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
|
@ -70,7 +70,7 @@ class WorkerAutomation(val unit: MapUnit) {
|
||||
if(unit.currentTile in roadableTiles) tileToConstructRoadOn = unit.currentTile
|
||||
else{
|
||||
val reachableTiles = roadableTiles.filter { unit.canMoveTo(it)&& unit.movementAlgs().canReach(it)}
|
||||
if(!reachableTiles.any()) continue
|
||||
if(reachableTiles.isEmpty()) continue
|
||||
tileToConstructRoadOn = reachableTiles.minBy { unit.movementAlgs().getShortestPath(it).size }!!
|
||||
unit.movementAlgs().headTowards(tileToConstructRoadOn)
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ class TradeLogic(val ourCivilization:CivilizationInfo, val otherCivilization: Ci
|
||||
offers.add(TradeOffer(city.name, TradeType.City, 0))
|
||||
|
||||
val otherCivsWeKnow = civInfo.diplomacy.values.map { it.otherCiv() }
|
||||
.filter { it != otherCivilization && !it.isBarbarianCivilization() }
|
||||
.filter { it != otherCivilization && !it.isBarbarianCivilization() && !it.isDefeated() }
|
||||
val civsWeKnowAndTheyDont = otherCivsWeKnow
|
||||
.filter { !otherCivilization.diplomacy.containsKey(it.civName) }
|
||||
.filter { !otherCivilization.diplomacy.containsKey(it.civName) && !it.isDefeated() }
|
||||
for(thirdCiv in civsWeKnowAndTheyDont){
|
||||
offers.add(TradeOffer("Introduction to " + thirdCiv.civName, TradeType.Introduction, 0))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user