aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/country/CountryInstance.cpp
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2024-09-27 14:57:38 +0200
committer GitHub <noreply@github.com>2024-09-27 14:57:38 +0200
commit9a84e7af70f2528578b00879e568bca285563e9b (patch)
treefbb752ea8c4bba4448dddcb87e5541df89f684fc /src/openvic-simulation/country/CountryInstance.cpp
parent7e895eaea194e266b112cb507b0d643083f2ad4b (diff)
parent45ea5382921f71bd247f57210937c3d384d46cdf (diff)
Merge pull request #207 from OpenVicProject/remove-culture
Added support for remove_culture custom instruction
Diffstat (limited to 'src/openvic-simulation/country/CountryInstance.cpp')
-rw-r--r--src/openvic-simulation/country/CountryInstance.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/openvic-simulation/country/CountryInstance.cpp b/src/openvic-simulation/country/CountryInstance.cpp
index 183b0c8..55ceb23 100644
--- a/src/openvic-simulation/country/CountryInstance.cpp
+++ b/src/openvic-simulation/country/CountryInstance.cpp
@@ -671,9 +671,13 @@ bool CountryInstance::apply_history_to_country(
bool ret = true;
- set_optional(primary_culture, entry.get_primary_culture());
- for (Culture const* culture : entry.get_accepted_cultures()) {
- ret &= add_accepted_culture(*culture);
+ set_optional(primary_culture, entry.get_primary_culture());
+ for (auto const& [culture, add] : entry.get_accepted_cultures()) {
+ if (add) {
+ ret &= add_accepted_culture(*culture);
+ } else {
+ ret &= remove_accepted_culture(*culture);
+ }
}
set_optional(religion, entry.get_religion());
if (entry.get_ruling_party()) {