diff options
author | Hop311 <Hop3114@gmail.com> | 2023-12-14 01:21:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 01:21:47 +0100 |
commit | df7c04079a7b5936e1701f37a845199bac94b1fb (patch) | |
tree | 83d5a86fe04594feada3c82258d9c08624e542be /src/openvic-simulation/misc | |
parent | 2e4110b26281605dde3e10f2183572d22bf773fc (diff) | |
parent | 3b6be81fb327a9c5e7bcc7c2127f513048e67480 (diff) |
Merge pull request #97 from OpenVicProject/moddable-strata
Made pop type strata moddable
Diffstat (limited to 'src/openvic-simulation/misc')
-rw-r--r-- | src/openvic-simulation/misc/Modifier.cpp | 24 | ||||
-rw-r--r-- | src/openvic-simulation/misc/Modifier.hpp | 2 |
2 files changed, 8 insertions, 18 deletions
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(); |