From 16349d6cad05497f983b1da123b6284ecfddd638 Mon Sep 17 00:00:00 2001 From: hop311 Date: Fri, 6 Sep 2024 23:07:27 +0100 Subject: Calculate country industrial power (states still need factory data) --- src/openvic-simulation/map/MapInstance.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/openvic-simulation/map/MapInstance.cpp') diff --git a/src/openvic-simulation/map/MapInstance.cpp b/src/openvic-simulation/map/MapInstance.cpp index 56b3642..ea174eb 100644 --- a/src/openvic-simulation/map/MapInstance.cpp +++ b/src/openvic-simulation/map/MapInstance.cpp @@ -94,11 +94,15 @@ bool MapInstance::apply_history_to_provinces( 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, country_manager); + for (auto const& [entry_date, entry] : history_map->get_entries()) { + if (entry_date > date) { + break; + } + + province.apply_history_to_province(*entry, country_manager); if (!entry->get_pops().empty()) { - pop_history_entry = entry; + pop_history_entry = entry.get(); } } -- cgit v1.2.3-56-ga3b1