aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp8
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp4
2 files changed, 7 insertions, 5 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp
index f99417f..ee0eaf4 100644
--- a/src/openvic-simulation/dataloader/Dataloader.cpp
+++ b/src/openvic-simulation/dataloader/Dataloader.cpp
@@ -562,11 +562,13 @@ bool Dataloader::_load_history(GameManager& game_manager, bool unused_history_fi
ret &= apply_to_files(
province_history_files,
- [this, &game_manager, &province_history_manager, &map, unused_history_file_warnings](fs::path const& file) -> bool {
+ [this, &game_manager, &province_history_manager, &map, unused_history_file_warnings](
+ fs::path const& file
+ ) -> bool {
const std::string filename = file.stem().string();
const std::string_view province_id = extract_basic_identifier_prefix(filename);
- Province const* province = map.get_province_by_identifier(province_id);
+ ProvinceDefinition const* province = map.get_province_definition_by_identifier(province_id);
if (province == nullptr) {
if (unused_history_file_warnings) {
Logger::warning("Found history file for non-existent province: ", province_id);
@@ -709,7 +711,7 @@ bool Dataloader::_load_map_dir(GameManager& game_manager) const {
bool ret = expect_dictionary_keys(
"max_provinces", ONE_EXACTLY,
- expect_uint<Province::index_t>(std::bind_front(&Map::set_max_provinces, &map)),
+ expect_uint<ProvinceDefinition::index_t>(std::bind_front(&Map::set_max_provinces, &map)),
"sea_starts", ONE_EXACTLY,
expect_list_reserve_length(
water_province_identifiers, expect_identifier(vector_callback(water_province_identifiers))
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index 0bb4d5b..92682e7 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -473,8 +473,8 @@ namespace OpenVic {
}
template<typename T>
- Callback<T const&> auto vector_callback_pointer(std::vector<T const*>& vec) {
- return [&vec](T const& val) -> bool {
+ Callback<T&> auto vector_callback_pointer(std::vector<T*>& vec) {
+ return [&vec](T& val) -> bool {
vec.emplace_back(&val);
return true;
};