mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-15 02:09:21 +07:00
Removed double trade processing and notifications from Treaties
This commit is contained in:
@ -124,11 +124,15 @@ class TradeLogic(val ourCivilization:Civilization, val otherCivilization: Civili
|
||||
to.popupAlerts.add(PopupAlert(AlertType.CityTraded, city.id))
|
||||
}
|
||||
TradeType.Treaty -> {
|
||||
// Note: Treaties are not transfered from both sides due to notifications and double signing
|
||||
if (offer.name == Constants.peaceTreaty) to.getDiplomacyManager(from).makePeace()
|
||||
if (offer.name == Constants.researchAgreement) {
|
||||
to.addGold(-offer.amount)
|
||||
from.addGold(-offer.amount)
|
||||
to.getDiplomacyManager(from)
|
||||
.setFlag(DiplomacyFlags.ResearchAgreement, offer.duration)
|
||||
from.getDiplomacyManager(to)
|
||||
.setFlag(DiplomacyFlags.ResearchAgreement, offer.duration)
|
||||
}
|
||||
if (offer.name == Constants.defensivePact) from.getDiplomacyManager(to).signDefensivePact(offer.duration);
|
||||
}
|
||||
@ -155,8 +159,8 @@ class TradeLogic(val ourCivilization:Civilization, val otherCivilization: Civili
|
||||
|
||||
for (offer in currentTrade.theirOffers.filter { it.type == TradeType.Treaty })
|
||||
transferTrade(otherCivilization, ourCivilization, offer)
|
||||
for (offer in currentTrade.ourOffers.filter { it.type == TradeType.Treaty })
|
||||
transferTrade(ourCivilization, otherCivilization, offer)
|
||||
// for (offer in currentTrade.ourOffers.filter { it.type == TradeType.Treaty })
|
||||
// transferTrade(ourCivilization, otherCivilization, offer)
|
||||
|
||||
ourCivilization.cache.updateCivResources()
|
||||
ourCivilization.updateStatsForNextTurn()
|
||||
|
Reference in New Issue
Block a user