diff options
author | hop311 <hop3114@gmail.com> | 2024-01-03 01:13:39 +0100 |
---|---|---|
committer | hop311 <hop3114@gmail.com> | 2024-01-03 01:13:39 +0100 |
commit | e067471f55cd11c6cd86920f9486991d6b552726 (patch) | |
tree | fa0904084e5e6a842e0ca9060155ed7ad30dc9a8 /src/openvic-simulation/politics/Issue.cpp | |
parent | d893c0ad8c6a0c347dcec72762be49f20886a90a (diff) |
Mutually exclusive rule groups + modded building rules
Diffstat (limited to 'src/openvic-simulation/politics/Issue.cpp')
-rw-r--r-- | src/openvic-simulation/politics/Issue.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
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); |