From e067471f55cd11c6cd86920f9486991d6b552726 Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 3 Jan 2024 00:13:39 +0000 Subject: Mutually exclusive rule groups + modded building rules --- src/openvic-simulation/politics/Issue.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/politics/Issue.cpp') diff --git a/src/openvic-simulation/politics/Issue.cpp b/src/openvic-simulation/politics/Issue.cpp index 3e64af4..28e34cb 100644 --- a/src/openvic-simulation/politics/Issue.cpp +++ b/src/openvic-simulation/politics/Issue.cpp @@ -95,8 +95,19 @@ bool IssueManager::add_reform( } if (group->get_type().is_uncivilised()) { - if (technology_cost <= 0) { - Logger::warning("Non-positive technology cost ", technology_cost, " found in uncivilised reform ", identifier, "!"); + if (ordinal == 0) { + if (technology_cost != 0) { + Logger::warning( + "Non-zero technology cost ", technology_cost, " found in ordinal 0 uncivilised reform ", identifier, "!" + ); + } + } else { + if (technology_cost <= 0) { + Logger::warning( + "Non-positive technology cost ", technology_cost, " found in ordinal ", ordinal, + " uncivilised reform ", identifier, "!" + ); + } } } else if (technology_cost != 0) { Logger::warning("Non-zero technology cost ", technology_cost, " found in civilised reform ", identifier, "!"); @@ -184,8 +195,11 @@ bool IssueManager::load_issues_file(ModifierManager const& modifier_manager, Rul if (key == "party_issues") { return expect_length(add_variable_callback(expected_issue_groups))(value); } else { + static const string_set_t uncivilised_reform_groups { + "economic_reforms", "education_reforms", "military_reforms" + }; return expect_length(add_variable_callback(expected_reform_groups))(value) - & add_reform_type(key, key == "economic_reforms" || key == "education_reforms" || key == "military_reforms"); + & add_reform_type(key, uncivilised_reform_groups.contains(key)); } } )(root); -- cgit v1.2.3-56-ga3b1