From 41e64e04c309799ba56a079234a6bd395cb21786 Mon Sep 17 00:00:00 2001 From: past-due <30942300+past-due@users.noreply.github.com> Date: Mon, 23 Oct 2023 13:23:34 -0400 Subject: [PATCH] game.cpp: Additional debug logging for fixedMapIdToGeneratedId --- src/game.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index 1f49482588f..1e7ef71a316 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -5201,7 +5201,11 @@ static bool loadWzMapDroidInit(WzMap::Map &wzMap, std::unordered_map 0) { bool addedMapping = fixedMapIdToGeneratedId.insert(std::unordered_map::value_type(droid.id.value(), newID)).second; - if (!addedMapping) + if (addedMapping) + { + debug(LOG_MAP, "Fixed map object ID: %" PRIu32 " -> generated id: %" PRIu32, droid.id.value(), newID); + } + else { debug(LOG_ERROR, "Found duplicate hard-coded object ID in map data: %" PRIu32 "", droid.id.value()); } @@ -6141,7 +6145,11 @@ static bool loadWzMapStructure(WzMap::Map& wzMap, std::unordered_map 0) { bool addedMapping = fixedMapIdToGeneratedId.insert(std::unordered_map::value_type(structure.id.value(), newID)).second; - if (!addedMapping) + if (addedMapping) + { + debug(LOG_MAP, "Fixed map object ID: %" PRIu32 " -> generated id: %" PRIu32, structure.id.value(), newID); + } + else { debug(LOG_ERROR, "Found duplicate hard-coded object ID in map data: %" PRIu32 "", structure.id.value()); } @@ -6891,7 +6899,11 @@ static bool loadWzMapFeature(WzMap::Map &wzMap, std::unordered_map 0) { bool addedMapping = fixedMapIdToGeneratedId.insert(std::unordered_map::value_type(feature.id.value(), newID)).second; - if (!addedMapping) + if (addedMapping) + { + debug(LOG_MAP, "Fixed map object ID: %" PRIu32 " -> generated id: %" PRIu32, feature.id.value(), newID); + } + else { debug(LOG_ERROR, "Found duplicate hard-coded object ID in map data: %" PRIu32 "", feature.id.value()); }