diff options
author | Hop311 <Hop3114@gmail.com> | 2024-09-21 15:34:22 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-21 15:34:22 +0200 |
commit | 4b69a91a6db50f86efec503b56b07573c692df9f (patch) | |
tree | 68fca0f77f6b20f3e1fe98d32a5a79311cfd3edc /src/openvic-simulation/research/Invention.cpp | |
parent | 85da7fb84197d617d1b3cde6969bf7bcfbb93d1d (diff) | |
parent | e35ff8ed703b0b6a5496a21a29e0b274c6a36874 (diff) |
Merge pull request #204 from OpenVicProject/fix-modifiers
Fix modifiers
Diffstat (limited to 'src/openvic-simulation/research/Invention.cpp')
-rw-r--r-- | src/openvic-simulation/research/Invention.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/openvic-simulation/research/Invention.cpp b/src/openvic-simulation/research/Invention.cpp index 5ecfcdc..299cefb 100644 --- a/src/openvic-simulation/research/Invention.cpp +++ b/src/openvic-simulation/research/Invention.cpp @@ -18,7 +18,7 @@ Invention::Invention( bool new_unlock_gas_defence, ConditionScript&& new_limit, ConditionalWeight&& new_chance -) : Modifier { new_identifier, std::move(new_values) }, +) : Modifier { new_identifier, std::move(new_values), modifier_type_t::INVENTION }, news { new_news }, activated_units { std::move(new_activated_units) }, activated_buildings { std::move(new_activated_buildings) }, @@ -30,8 +30,10 @@ Invention::Invention( bool Invention::parse_scripts(DefinitionManager const& definition_manager) { bool ret = true; + ret &= limit.parse_script(false, definition_manager); ret &= chance.parse_scripts(definition_manager); + return ret; } @@ -104,8 +106,10 @@ bool InventionManager::load_inventions_file( bool InventionManager::parse_scripts(DefinitionManager const& definition_manager) { bool ret = true; + for (Invention& invention : inventions.get_items()) { ret &= invention.parse_scripts(definition_manager); } + return ret; } |