diff options
Diffstat (limited to 'src/openvic-simulation/modifier/ModifierManager.cpp')
-rw-r--r-- | src/openvic-simulation/modifier/ModifierManager.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-simulation/modifier/ModifierManager.cpp b/src/openvic-simulation/modifier/ModifierManager.cpp index c9072c8..f21712d 100644 --- a/src/openvic-simulation/modifier/ModifierManager.cpp +++ b/src/openvic-simulation/modifier/ModifierManager.cpp @@ -7,11 +7,18 @@ bool ModifierManager::add_modifier_effect( ModifierEffect const*& effect_cache, std::string_view identifier, bool positive_good, ModifierEffect::format_t format, ModifierEffect::target_t targets, std::string_view localisation_key ) { + using enum ModifierEffect::target_t; + if (identifier.empty()) { Logger::error("Invalid modifier effect identifier - empty!"); return false; } + if (targets == NO_TARGETS) { + Logger::error("Invalid targets for modifier effect \"", identifier, "\" - none!"); + return false; + } + if (effect_cache != nullptr) { Logger::error( "Cache variable for modifier effect \"", identifier, "\" is already filled with modifier effect \"", |