Resolved #880 - Notifications for end-of-trade no longer activate after instant trade

This commit is contained in:
Yair Morgenstern 2019-06-19 17:48:26 +03:00
parent b0e43ace59
commit 27c83f1792

View File

@ -219,12 +219,14 @@ class DiplomacyManager() {
fun nextTurn(){
for(trade in trades.toList()){
for(offer in trade.ourOffers.union(trade.theirOffers).filter { it.duration>0 })
for(offer in trade.ourOffers.union(trade.theirOffers).filter { it.duration>0 }) {
offer.duration--
if(offer.duration==0)
civInfo.addNotification("["+offer.name+"] from [$otherCivName] has ended",null, Color.GOLD)
}
if(trade.ourOffers.all { it.duration<=0 } && trade.theirOffers.all { it.duration<=0 }) {
trades.remove(trade)
civInfo.addNotification("One of our trades with [$otherCivName] has ended!".tr(),null, Color.YELLOW)
}
}
removeUntenebleTrades()