aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history/ProvinceHistory.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2024-09-10 00:04:30 +0200
committer GitHub <noreply@github.com>2024-09-10 00:04:30 +0200
commit7a9206e3869fbb659d296b854c90f5c81755a5ca (patch)
tree1e00781e634cbb7ea6f31343f6751f7755bd53ef /src/openvic-simulation/history/ProvinceHistory.cpp
parent79dbf71dd23623059ea9eabd87956f93604be1ed (diff)
parentd67cd2d08fe2859809e35b93f5a8358c48a3705e (diff)
Merge pull request #195 from OpenVicProject/ranking
Ranking System
Diffstat (limited to 'src/openvic-simulation/history/ProvinceHistory.cpp')
-rw-r--r--src/openvic-simulation/history/ProvinceHistory.cpp6
1 files changed, 4 insertions, 2 deletions
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<ProvinceDefinition> const& provinces = map_definition.get_province_definitions();
std::vector<bool> 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;