aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/history
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-01-17 23:24:39 +0100
committer hop311 <hop3114@gmail.com>2024-01-18 23:29:40 +0100
commite33a330129364b4bd632b2fd531a996b8c57cefb (patch)
tree88365260addebee9d3ac798d484e02ab18f56692 /src/openvic-simulation/history
parentb5783116f67c9f7aa9d8d9653e6bda0227f67cd2 (diff)
Parse missing variables, Logger counting, misc cleanup
Diffstat (limited to 'src/openvic-simulation/history')
-rw-r--r--src/openvic-simulation/history/ProvinceHistory.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/openvic-simulation/history/ProvinceHistory.cpp b/src/openvic-simulation/history/ProvinceHistory.cpp
index 4117450..fd174a3 100644
--- a/src/openvic-simulation/history/ProvinceHistory.cpp
+++ b/src/openvic-simulation/history/ProvinceHistory.cpp
@@ -36,7 +36,11 @@ bool ProvinceHistoryMap::_load_history_entry(
BuildingType const* building_type = building_type_manager.get_building_type_by_identifier(key);
if (building_type != nullptr) {
if (building_type->is_in_province()) {
- return expect_uint<BuildingType::level_t>(map_callback(entry.province_buildings, building_type))(value);
+ return expect_uint<BuildingType::level_t>(
+ /* This is set to warn to prevent vanilla from always having errors because
+ * of a duplicate railroad entry in the 1861.1.1 history of Manchester (278). */
+ map_callback(entry.province_buildings, building_type, true)
+ )(value);
} else {
Logger::error(
"Attempted to add state building \"", building_type, "\" at top scope of province history for ",
@@ -68,7 +72,7 @@ bool ProvinceHistoryMap::_load_history_entry(
),
"party_loyalty", ZERO_OR_MORE, [&ideology_manager, &entry](ast::NodeCPtr node) -> bool {
Ideology const* ideology = nullptr;
- fixed_point_t amount = 0; // percent I do believe
+ fixed_point_t amount = 0; /* PERCENTAGE_DECIMAL */
bool ret = expect_dictionary_keys(
"ideology", ONE_EXACTLY, ideology_manager.expect_ideology_identifier(
@@ -90,7 +94,7 @@ bool ProvinceHistoryMap::_load_history_entry(
"building", ONE_EXACTLY, building_type_manager.expect_building_type_identifier(
assign_variable_callback_pointer(building_type)
),
- "upgrade", ZERO_OR_ONE, success_callback // doesn't appear to have an effect
+ "upgrade", ZERO_OR_ONE, success_callback /* Doesn't appear to have an effect */
)(node);
if (building_type != nullptr) {
if (!building_type->is_in_province()) {