From 3edcc29857ec54b581706825f6084c32843659f9 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 12 Nov 2024 17:39:27 +0200 Subject: [PATCH] Resolve #12459 - don't allow trading away max gold/max gpt to multiple civs --- core/src/com/unciv/logic/trade/TradeEvaluation.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/trade/TradeEvaluation.kt b/core/src/com/unciv/logic/trade/TradeEvaluation.kt index 0758a03137..7d289af2b1 100644 --- a/core/src/com/unciv/logic/trade/TradeEvaluation.kt +++ b/core/src/com/unciv/logic/trade/TradeEvaluation.kt @@ -46,8 +46,9 @@ class TradeEvaluation { } return when (tradeOffer.type) { - TradeOfferType.Gold -> true // even if they go negative it's okay - TradeOfferType.Gold_Per_Turn -> true // even if they go negative it's okay + // if they go a little negative it's okay, but don't allowing going overboard (promising same gold to many) + TradeOfferType.Gold -> tradeOffer.amount * 0.9f < offerer.gold + TradeOfferType.Gold_Per_Turn -> tradeOffer.amount * 0.9f < offerer.stats.statsForNextTurn.gold TradeOfferType.Treaty -> { // Current automation should prevent these from being offered anyway, // these are a safeguard against future automation changes