aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Map.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-12-12 01:34:53 +0100
committer hop311 <hop3114@gmail.com>2023-12-13 20:54:36 +0100
commit89c93f98b865c20cd3c3486a9b91323565e759fc (patch)
tree54155b9cf2a4384585941495f7525b77fa60d4e7 /src/openvic-simulation/map/Map.cpp
parentf556519575bbbf24d247f341ca762fb1878ed64d (diff)
Province pop history + country government flag override refactors
Diffstat (limited to 'src/openvic-simulation/map/Map.cpp')
-rw-r--r--src/openvic-simulation/map/Map.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp
index 18f72cf..5d8c6e2 100644
--- a/src/openvic-simulation/map/Map.cpp
+++ b/src/openvic-simulation/map/Map.cpp
@@ -294,8 +294,15 @@ bool Map::apply_history_to_provinces(ProvinceHistoryManager const& history_manag
if (!province.get_water()) {
ProvinceHistoryMap const* history_map = history_manager.get_province_history(&province);
if (history_map != nullptr) {
+ ProvinceHistoryEntry const* pop_history_entry = nullptr;
for (ProvinceHistoryEntry const* entry : history_map->get_entries_up_to(date)) {
province.apply_history_to_province(entry);
+ if (!entry->get_pops().empty()) {
+ pop_history_entry = entry;
+ }
+ }
+ if (pop_history_entry != nullptr) {
+ province.add_pop_vec(pop_history_entry->get_pops());
}
}
}