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/history/ProvinceHistory.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/openvic-simulation/history/ProvinceHistory.cpp') diff --git a/src/openvic-simulation/history/ProvinceHistory.cpp b/src/openvic-simulation/history/ProvinceHistory.cpp index ca0bf4e..ef8793b 100644 --- a/src/openvic-simulation/history/ProvinceHistory.cpp +++ b/src/openvic-simulation/history/ProvinceHistory.cpp @@ -157,8 +157,10 @@ void ProvinceHistoryManager::lock_province_histories(MapDefinition const& map_de std::vector const& provinces = map_definition.get_province_definitions(); std::vector province_checklist(provinces.size()); - for (decltype(province_histories)::value_type const& entry : province_histories) { - province_checklist[entry.first->get_index() - 1] = true; + for (auto [province, history_map] : mutable_iterator(province_histories)) { + province_checklist[province->get_index() - 1] = true; + + history_map.sort_entries(); } size_t missing = 0; -- cgit v1.2.3-56-ga3b1