From f9e74e6994fc9cdfafd4b7e0c5b1b27e05d6818d Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 31 Aug 2025 20:33:16 -0700 Subject: [PATCH] Add more logging around rewarding items (#1861) --- dGame/dComponents/InventoryComponent.cpp | 1 + dGame/dMission/Mission.cpp | 4 ++-- dGame/dUtilities/Loot.cpp | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 4cc0a3de..b983759d 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -180,6 +180,7 @@ void InventoryComponent::AddItem( const int32_t sourceType, const bool bound, int32_t preferredSlot) { + LOG("AddItem %i %i %s %s", lot, count, StringifiedEnum::ToString(lootSourceType).data(), StringifiedEnum::ToString(inventoryType).data()); if (count == 0) { LOG("Attempted to add 0 of item (%i) to the inventory!", lot); diff --git a/dGame/dMission/Mission.cpp b/dGame/dMission/Mission.cpp index e8d2146e..ec430f3e 100644 --- a/dGame/dMission/Mission.cpp +++ b/dGame/dMission/Mission.cpp @@ -483,7 +483,7 @@ void Mission::YieldRewards() { // If a mission rewards zero of an item, make it reward 1. auto count = pair.second > 0 ? pair.second : 1; - + LOG("Player %llu is receiving %i of item %i from repeatable mission %i", entity->GetObjectID(), count, pair.first, info.id); inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT); } @@ -511,7 +511,7 @@ void Mission::YieldRewards() { // If a mission rewards zero of an item, make it reward 1. auto count = pair.second > 0 ? pair.second : 1; - + LOG("Player %llu is receiving %i of item %i from mission %i", entity->GetObjectID(), count, pair.first, info.id); inventoryComponent->AddItem(pair.first, count, IsMission() ? eLootSourceType::MISSION : eLootSourceType::ACHIEVEMENT); } diff --git a/dGame/dUtilities/Loot.cpp b/dGame/dUtilities/Loot.cpp index 853ebd01..5cbdf2d4 100644 --- a/dGame/dUtilities/Loot.cpp +++ b/dGame/dUtilities/Loot.cpp @@ -129,6 +129,10 @@ std::unordered_map Loot::RollLootMatrix(Entity* player, uint32_t m } } + for (const auto& drop : drops) { + LOG("Player %llu has rolled %i of item %i from loot matrix %i", player->GetObjectID(), drop.second, drop.first, matrixIndex); + } + return drops; }