aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/research
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-01 00:23:35 +0200
committer hop311 <hop3114@gmail.com>2024-10-05 22:48:42 +0200
commitba4fe5d9a8596e1b73a3aa0735d471e25493d54b (patch)
treea760bb0c72e6ab2f135f7d003391a1f1f9245753 /src/openvic-simulation/research
parentf3f364f08cc8f1c80a5dfce689183c2f8f75bbd4 (diff)
Cache modifier effects in dedicated variables
Diffstat (limited to 'src/openvic-simulation/research')
-rw-r--r--src/openvic-simulation/research/Technology.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/openvic-simulation/research/Technology.cpp b/src/openvic-simulation/research/Technology.cpp
index 3284193..27bb4ca 100644
--- a/src/openvic-simulation/research/Technology.cpp
+++ b/src/openvic-simulation/research/Technology.cpp
@@ -199,13 +199,18 @@ bool TechnologyManager::generate_modifiers(ModifierManager& modifier_manager) co
using enum ModifierEffect::format_t;
using enum ModifierEffect::target_t;
+ IndexedMap<TechnologyFolder, ModifierEffect const*>& research_bonus_effects =
+ modifier_manager.modifier_effect_cache.research_bonus_effects;
+
+ research_bonus_effects.set_keys(&get_technology_folders());
+
bool ret = true;
for (TechnologyFolder const& folder : get_technology_folders()) {
const std::string modifier_identifier = StringUtils::append_string_views(folder.get_identifier(), "_research_bonus");
ret &= modifier_manager.add_modifier_effect(
- modifier_identifier, true, PROPORTION_DECIMAL, COUNTRY, modifier_identifier
+ research_bonus_effects[folder], modifier_identifier, true, PROPORTION_DECIMAL, COUNTRY, modifier_identifier
);
}