diff options
Diffstat (limited to 'src/openvic-simulation/research/Technology.cpp')
-rw-r--r-- | src/openvic-simulation/research/Technology.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/openvic-simulation/research/Technology.cpp b/src/openvic-simulation/research/Technology.cpp index 3ba3624..7851707 100644 --- a/src/openvic-simulation/research/Technology.cpp +++ b/src/openvic-simulation/research/Technology.cpp @@ -143,19 +143,22 @@ bool TechnologyManager::load_technologies_file( })(root); } -#define TECH_MODIFIER(NAME, POS) ret &= modifier_manager.add_modifier_effect(NAME, POS) -#define UNCIV_TECH_MODIFIER(NAME) TECH_MODIFIER(NAME, false); TECH_MODIFIER(StringUtils::append_string_views("self_", NAME), false); -bool TechnologyManager::generate_modifiers(ModifierManager& modifier_manager) { +bool TechnologyManager::generate_modifiers(ModifierManager& modifier_manager) const { bool ret = true; - UNCIV_TECH_MODIFIER("unciv_military_modifier"); - UNCIV_TECH_MODIFIER("unciv_economic_modifier"); + const auto unciv_tech_modifier = [&modifier_manager, &ret](std::string_view name) -> void { + ret &= modifier_manager.add_modifier_effect(name, false); + ret &= modifier_manager.add_modifier_effect(StringUtils::append_string_views("self_", name), false); + }; + + unciv_tech_modifier("unciv_military_modifier"); + unciv_tech_modifier("unciv_economic_modifier"); for (TechnologyFolder const& folder : get_technology_folders()) { - TECH_MODIFIER(StringUtils::append_string_views(folder.get_identifier(), "_research_bonus"), true); + ret &= modifier_manager.add_modifier_effect( + StringUtils::append_string_views(folder.get_identifier(), "_research_bonus"), true + ); } return ret; } -#undef UNCIV_TECH_MODIFIER -#undef TECH_MODIFIER
\ No newline at end of file |