From dfd8d5cbc9e92b6e7855df486a59b23a1a204502 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 29 Nov 2023 19:56:38 +0200 Subject: [PATCH] Resolved #10621 - Ruleset validation for negative-weight ruin rewards --- core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt index 647d589f01..a5fdfd91b8 100644 --- a/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt +++ b/core/src/com/unciv/models/ruleset/validation/RulesetValidator.kt @@ -178,6 +178,7 @@ class RulesetValidator(val ruleset: Ruleset) { tryFixUnknownUniques: Boolean ) { for (reward in ruleset.ruinRewards.values) { + if (reward.weight < 0) lines += "${reward.name} has a negative weight, which is not allowed!" for (difficulty in reward.excludedDifficulties) if (!ruleset.difficulties.containsKey(difficulty)) lines += "${reward.name} references difficulty ${difficulty}, which does not exist!"