aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/map/Map.cpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2023-10-12 21:19:00 +0200
committer hop311 <hop3114@gmail.com>2023-10-12 21:19:00 +0200
commite50c67eb1aaa54f5fb31425f81616bea4e6b880a (patch)
treec4fbc6ee494f8ad33a8de36be5fc300165ce05fc /src/openvic-simulation/map/Map.cpp
parentbb22324da1225a0ac458c1d69893bb3bd28bd6b7 (diff)
Lots of accumulated changes
Diffstat (limited to 'src/openvic-simulation/map/Map.cpp')
-rw-r--r--src/openvic-simulation/map/Map.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp
index 386e7be..8362ff4 100644
--- a/src/openvic-simulation/map/Map.cpp
+++ b/src/openvic-simulation/map/Map.cpp
@@ -78,11 +78,16 @@ bool Map::set_water_province(std::string_view identifier) {
}
bool Map::set_water_province_list(std::vector<std::string_view> const& list) {
+ if (water_provinces.is_locked()) {
+ Logger::error("The map's water provinces have already been locked!");
+ return false;
+ }
bool ret = true;
water_provinces.reserve(water_provinces.size() + list.size());
for (std::string_view const& identifier : list) {
ret &= set_water_province(identifier);
}
+ lock_water_provinces();
return ret;
}