aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Modifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/misc/Modifier.cpp')
-rw-r--r--src/openvic-simulation/misc/Modifier.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/openvic-simulation/misc/Modifier.cpp b/src/openvic-simulation/misc/Modifier.cpp
index 2e9232b..40698e5 100644
--- a/src/openvic-simulation/misc/Modifier.cpp
+++ b/src/openvic-simulation/misc/Modifier.cpp
@@ -234,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) {