From 89c93f98b865c20cd3c3486a9b91323565e759fc Mon Sep 17 00:00:00 2001 From: hop311 Date: Tue, 12 Dec 2023 00:34:53 +0000 Subject: Province pop history + country government flag override refactors --- src/openvic-simulation/map/Map.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/openvic-simulation/map/Map.cpp') 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()); } } } -- cgit v1.2.3-56-ga3b1