diff options
author | Hop311 <hop3114@gmail.com> | 2023-07-22 01:18:00 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-07-22 01:18:00 +0200 |
commit | 83e61b518788d21283cda481decafee4ee2e252c (patch) | |
tree | 4adc383884ad57f404913d5eb4d83da56d354b05 /src/openvic/map | |
parent | 420c2dce47e74c01ff46be991058d543e0c70a6b (diff) |
WIP structs for Pop, PopType, and Religion
Diffstat (limited to 'src/openvic/map')
-rw-r--r-- | src/openvic/map/Building.cpp | 4 | ||||
-rw-r--r-- | src/openvic/map/Map.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/openvic/map/Building.cpp b/src/openvic/map/Building.cpp index 317ccdf..07cbac9 100644 --- a/src/openvic/map/Building.cpp +++ b/src/openvic/map/Building.cpp @@ -100,11 +100,11 @@ return_t BuildingManager::add_building_type(std::string const& identifier, Build return FAILURE; } if (max_level < 0) { - Logger::error("Invalid building type max level: ", max_level); + Logger::error("Invalid building type max level for ", identifier, ": ", max_level); return FAILURE; } if (build_time < 0) { - Logger::error("Invalid building type build time: ", build_time); + Logger::error("Invalid building type build time for ", identifier, ": ", build_time); return FAILURE; } return building_types.add_item({ identifier, max_level, build_time }); diff --git a/src/openvic/map/Map.cpp b/src/openvic/map/Map.cpp index 2efee32..936add0 100644 --- a/src/openvic/map/Map.cpp +++ b/src/openvic/map/Map.cpp @@ -39,7 +39,7 @@ return_t Map::add_province(std::string const& identifier, colour_t colour) { return FAILURE; } if (colour == NULL_COLOUR || colour > MAX_COLOUR_RGB) { - Logger::error("Invalid province colour: ", Province::colour_to_hex_string(colour)); + Logger::error("Invalid province colour for ", identifier, ": ", Province::colour_to_hex_string(colour)); return FAILURE; } Province new_province { static_cast<index_t>(provinces.get_item_count() + 1), identifier, colour }; @@ -91,26 +91,26 @@ return_t Map::add_region(std::string const& identifier, std::vector<std::string> Province* province = get_province_by_identifier(province_identifier); if (province != nullptr) { if (new_region.contains_province(province)) { - Logger::error("Duplicate province identifier ", province_identifier); + Logger::error("Duplicate province identifier ", province_identifier, " in region ", identifier); ret = FAILURE; } else { size_t other_region_index = reinterpret_cast<size_t>(province->get_region()); if (other_region_index != 0) { other_region_index--; if (other_region_index < regions.get_item_count()) - Logger::error("Province ", province_identifier, " is already part of ", regions.get_item_by_index(other_region_index)->get_identifier()); + Logger::error("Cannot add province ", province_identifier, " to region ", identifier, " - it is already part of ", regions.get_item_by_index(other_region_index)->get_identifier()); else - Logger::error("Province ", province_identifier, " is already part of an unknown region with index ", other_region_index); + Logger::error("Cannot add province ", province_identifier, " to region ", identifier, " - it is already part of an unknown region with index ", other_region_index); ret = FAILURE; } else new_region.provinces.push_back(province); } } else { - Logger::error("Invalid province identifier ", province_identifier); + Logger::error("Invalid province identifier ", province_identifier, " for region ", identifier); ret = FAILURE; } } if (!new_region.get_province_count()) { - Logger::error("No valid provinces in region's list"); + Logger::error("No valid provinces in list for ", identifier); return FAILURE; } |