mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 07:16:54 +07:00
Game can handle resources "disappearing" between versions (esp. for mods)
This commit is contained in:
parent
ee05bc28ec
commit
fd207d55c6
@ -3,8 +3,8 @@ package com.unciv.build
|
||||
object BuildConfig {
|
||||
const val kotlinVersion = "1.4.30"
|
||||
const val appName = "Unciv"
|
||||
const val appCodeNumber = 539
|
||||
const val appVersion = "3.13.5-patch1"
|
||||
const val appCodeNumber = 540
|
||||
const val appVersion = "3.13.5-patch2"
|
||||
|
||||
const val gdxVersion = "1.9.14"
|
||||
const val roboVMVersion = "2.3.1"
|
||||
|
@ -292,6 +292,7 @@ class GameInfo {
|
||||
civInfo.policies.adoptedPolicies.remove("Facism")
|
||||
civInfo.policies.adoptedPolicies.add("Fascism")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -253,7 +253,8 @@ class DiplomacyManager() {
|
||||
fun resourcesFromTrade(): ResourceSupplyList {
|
||||
val counter = ResourceSupplyList()
|
||||
val resourcesMap = civInfo.gameInfo.ruleSet.tileResources
|
||||
val isResourceFilter: (TradeOffer) -> Boolean = { it.type == TradeType.Strategic_Resource || it.type == TradeType.Luxury_Resource }
|
||||
val isResourceFilter: (TradeOffer) -> Boolean = { (it.type == TradeType.Strategic_Resource || it.type == TradeType.Luxury_Resource)
|
||||
&& civInfo.gameInfo.ruleSet.tileResources.containsKey(it.name) }
|
||||
for (trade in trades) {
|
||||
for (offer in trade.ourOffers.filter(isResourceFilter))
|
||||
counter.add(resourcesMap[offer.name]!!, -offer.amount, "Trade")
|
||||
@ -294,7 +295,7 @@ class DiplomacyManager() {
|
||||
|
||||
for (offer in trade.ourOffers) {
|
||||
if (offer.type in listOf(TradeType.Luxury_Resource, TradeType.Strategic_Resource)
|
||||
&& offer.name in negativeCivResources) {
|
||||
&& (offer.name in negativeCivResources || !civInfo.gameInfo.ruleSet.tileResources.containsKey(offer.name))) {
|
||||
trades.remove(trade)
|
||||
val otherCivTrades = otherCiv().getDiplomacyManager(civInfo).trades
|
||||
otherCivTrades.removeAll { it.equals(trade.reverse()) }
|
||||
|
Loading…
Reference in New Issue
Block a user