diff options
author | Shauren <shauren.trinity@gmail.com> | 2022-09-17 20:58:24 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-09-17 20:58:24 +0200 |
commit | c00e2e4851498aa04ac1d8ff13a0759b245df72b (patch) | |
tree | 8745da084a4787c222cc3441ae0b3703793d2e03 /src/server/game/Handlers/LootHandler.cpp | |
parent | 3ef5079feeedfdafc9d3c1d9f865e96dbc77ecc8 (diff) |
Core/Loot: Simplify loot containers
* Unify items and quest_items
* Drop PlayerQuestItems and PlayerNonQuestNonFFAConditionalItems
Diffstat (limited to 'src/server/game/Handlers/LootHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/LootHandler.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index d14810c2b32..a367e18da8e 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -107,7 +107,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPackets::Loot::LootItem& p } } - player->StoreLootItem(lguid, req.LootListID - 1, loot, aeResultPtr); + player->StoreLootItem(lguid, req.LootListID, loot, aeResultPtr); // If player is removing the last LootItem, delete the empty container. if (loot->isLooted() && lguid.IsItem()) @@ -413,15 +413,14 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPackets::Loot::MasterLootItem if (!loot || loot->GetLootMethod() != MASTER_LOOT) return; - uint8 slotid = req.LootListID - 1; - if (slotid >= loot->items.size() + loot->quest_items.size()) + if (req.LootListID >= loot->items.size()) { - TC_LOG_DEBUG("loot", "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", - GetPlayer()->GetName().c_str(), slotid, (unsigned long)loot->items.size()); + TC_LOG_DEBUG("loot", "MasterLootItem: Player %s might be using a hack! (slot %d, size " SZFMTD ")", + GetPlayer()->GetName().c_str(), req.LootListID, loot->items.size()); return; } - LootItem& item = slotid >= loot->items.size() ? loot->quest_items[slotid - loot->items.size()] : loot->items[slotid]; + LootItem& item = loot->items[req.LootListID]; ItemPosCountVec dest; InventoryResult msg = target->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, item.itemid, item.count); @@ -446,7 +445,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPackets::Loot::MasterLootItem item.count = 0; item.is_looted = true; - loot->NotifyItemRemoved(slotid, GetPlayer()->GetMap()); + loot->NotifyItemRemoved(req.LootListID, GetPlayer()->GetMap()); --loot->unlootedCount; } @@ -461,7 +460,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPackets::Loot::MasterLootItem void WorldSession::HandleLootRoll(WorldPackets::Loot::LootRoll& packet) { - LootRoll* lootRoll = GetPlayer()->GetLootRoll(packet.LootObj, packet.LootListID - 1); + LootRoll* lootRoll = GetPlayer()->GetLootRoll(packet.LootObj, packet.LootListID); if (!lootRoll) return; |