From 3b6be81fb327a9c5e7bcc7c2127f513048e67480 Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 13 Dec 2023 23:56:20 +0000 Subject: Removed modifier generating macros. --- src/openvic-simulation/misc/Modifier.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/openvic-simulation/misc/Modifier.cpp') 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) { -- cgit v1.2.3-56-ga3b1