Add more logging around rewarding items (#1861)

This commit is contained in:
David Markowitz
2025-08-31 20:33:16 -07:00
committed by GitHub
parent 21a2ddcfd9
commit f9e74e6994
3 changed files with 7 additions and 2 deletions

View File

@@ -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);

View File

@@ -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);
}

View File

@@ -129,6 +129,10 @@ std::unordered_map<LOT, int32_t> 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;
}