aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/misc/Modifier.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-14 00:56:20 +0100
committer hop311 <hop3114@gmail.com>2023-12-14 00:56:20 +0100
commit3b6be81fb327a9c5e7bcc7c2127f513048e67480 (patch)
tree83d5a86fe04594feada3c82258d9c08624e542be /src/openvic-simulation/misc/Modifier.cpp
parent35e07b57aed9177be1bfeb7732ed8f17c71f2354 (diff)
Removed modifier generating macros.
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) {