diff options
Diffstat (limited to 'src/openvic-simulation/misc')
-rw-r--r-- | src/openvic-simulation/misc/Decision.cpp | 4 | ||||
-rw-r--r-- | src/openvic-simulation/misc/Modifier.cpp | 24 | ||||
-rw-r--r-- | src/openvic-simulation/misc/Modifier.hpp | 2 |
3 files changed, 10 insertions, 20 deletions
diff --git a/src/openvic-simulation/misc/Decision.cpp b/src/openvic-simulation/misc/Decision.cpp index 9200688..f1f2b6c 100644 --- a/src/openvic-simulation/misc/Decision.cpp +++ b/src/openvic-simulation/misc/Decision.cpp @@ -34,7 +34,7 @@ bool DecisionManager::add_decision( } } - return decisions.add_item({ + return decisions.add_item({ identifier, alert, news, @@ -42,7 +42,7 @@ bool DecisionManager::add_decision( news_desc_long, news_desc_medium, news_desc_short, - picture + picture }, duplicate_warning_callback); } diff --git a/src/openvic-simulation/misc/Modifier.cpp b/src/openvic-simulation/misc/Modifier.cpp index ac052c2..40698e5 100644 --- a/src/openvic-simulation/misc/Modifier.cpp +++ b/src/openvic-simulation/misc/Modifier.cpp @@ -132,11 +132,6 @@ bool ModifierManager::setup_modifier_effects() { ret &= add_modifier_effect("max_tariff", true); ret &= add_modifier_effect("max_tax", true); ret &= add_modifier_effect("max_war_exhaustion", true, PERCENTAGE_DECIMAL); - ret &= add_modifier_effect("middle_income_modifier", true); - ret &= add_modifier_effect("middle_life_needs", true); - ret &= add_modifier_effect("middle_everyday_needs", true); - ret &= add_modifier_effect("middle_luxury_needs", true); - ret &= add_modifier_effect("middle_vote", true); ret &= add_modifier_effect("min_military_spending", true); ret &= add_modifier_effect("min_social_spending", true); ret &= add_modifier_effect("min_tariff", true); @@ -150,11 +145,6 @@ bool ModifierManager::setup_modifier_effects() { ret &= add_modifier_effect("non_accepted_pop_militancy_modifier", false, RAW_DECIMAL); ret &= add_modifier_effect("org_regain", true); ret &= add_modifier_effect("political_reform_desire", false); - ret &= add_modifier_effect("poor_income_modifier", true); - ret &= add_modifier_effect("poor_life_needs", true); - ret &= add_modifier_effect("poor_everyday_needs", true); - ret &= add_modifier_effect("poor_luxury_needs", true); - ret &= add_modifier_effect("poor_vote", true); ret &= add_modifier_effect("prestige", true, RAW_DECIMAL); ret &= add_modifier_effect("research_points", true, RAW_DECIMAL); ret &= add_modifier_effect("research_points_modifier", true); @@ -163,11 +153,6 @@ bool ModifierManager::setup_modifier_effects() { ret &= add_modifier_effect("RGO_output", true); ret &= add_modifier_effect("rgo_throughput", true); ret &= add_modifier_effect("RGO_throughput", true); - ret &= add_modifier_effect("rich_income_modifier", true); - ret &= add_modifier_effect("rich_life_needs", true); - ret &= add_modifier_effect("rich_everyday_needs", true); - ret &= add_modifier_effect("rich_luxury_needs", true); - ret &= add_modifier_effect("rich_vote", true); ret &= add_modifier_effect("ruling_party_support", true); ret &= add_modifier_effect("social_reform_desire", false); ret &= add_modifier_effect("supply_consumption", false); @@ -249,8 +234,13 @@ bool ModifierManager::setup_modifier_effects() { return ret; } -void ModifierManager::register_complex_modifier(std::string_view identifier) { - complex_modifiers.emplace(identifier); +bool ModifierManager::register_complex_modifier(std::string_view identifier) { + if (complex_modifiers.emplace(identifier).second) { + return true; + } else { + Logger::error("Duplicate complex modifier: ", identifier); + return false; + } } bool ModifierManager::add_event_modifier(std::string_view identifier, ModifierValue&& values, Modifier::icon_t icon) { diff --git a/src/openvic-simulation/misc/Modifier.hpp b/src/openvic-simulation/misc/Modifier.hpp index a176d6c..f3a2499 100644 --- a/src/openvic-simulation/misc/Modifier.hpp +++ b/src/openvic-simulation/misc/Modifier.hpp @@ -129,7 +129,7 @@ namespace OpenVic { ModifierEffect::format_t format = ModifierEffect::format_t::PROPORTION_DECIMAL ); - void register_complex_modifier(std::string_view identifier); + bool register_complex_modifier(std::string_view identifier); bool setup_modifier_effects(); |