diff --git a/core/src/com/unciv/logic/trade/TradeEvaluation.kt b/core/src/com/unciv/logic/trade/TradeEvaluation.kt index b15094edd8..140bdc1794 100644 --- a/core/src/com/unciv/logic/trade/TradeEvaluation.kt +++ b/core/src/com/unciv/logic/trade/TradeEvaluation.kt @@ -338,7 +338,10 @@ class TradeEvaluation { val percentageAdvantage = absoluteAdvantage / theirCombatStrength.toFloat() // We don't add the same constraint here. We should not make peace easily if we're // heavily advantaged. - return (absoluteAdvantage * percentageAdvantage).toInt() * 10 + val totalAdvantage = (absoluteAdvantage * percentageAdvantage).toInt() * 10 + if(totalAdvantage < 0) //May be a negative number if strength disparity is such that it leads to integer overflow + return 10000 //in that rare case, the AI would accept peace against a defeated foe. + return totalAdvantage } else { // This results in huge values for large power imbalances. However, we should not give // up everything just because there is a big power imbalance. There's a better chance to