From 237e42fd1cdff02862c6a2279c7cad9786ab0e65 Mon Sep 17 00:00:00 2001 From: hop311 Date: Wed, 11 Sep 2024 00:21:03 +0100 Subject: CountryInstance unlock tech, invention, crime, building, unit, gas etc. --- src/openvic-simulation/history/CountryHistory.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/openvic-simulation/history/CountryHistory.cpp') diff --git a/src/openvic-simulation/history/CountryHistory.cpp b/src/openvic-simulation/history/CountryHistory.cpp index 04f6292..cd51e19 100644 --- a/src/openvic-simulation/history/CountryHistory.cpp +++ b/src/openvic-simulation/history/CountryHistory.cpp @@ -54,7 +54,17 @@ bool CountryHistoryMap::_load_history_entry( { Technology const* technology = technology_manager.get_technology_by_identifier(key); if (technology != nullptr) { - return expect_int_bool(map_callback(entry.technologies, technology))(value); + return expect_uint( + [&entry, technology](decltype(entry.technologies)::mapped_type value) -> bool { + if (value > 1) { + Logger::warning( + "Technology ", technology->get_identifier(), + " is applied multiple times in history of country ", entry.get_country().get_identifier() + ); + } + return map_callback(entry.technologies, technology)(value); + } + )(value); } } -- cgit v1.2.3-56-ga3b1