From 219d929324740b6ce04b233f91009171b0d3c987 Mon Sep 17 00:00:00 2001 From: Walter Pagani Date: Mon, 11 Mar 2024 21:18:26 -0300 Subject: [PATCH] fix. Close the loot bag when taking the gold (#33) --- src/AoeLoot_SC.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/AoeLoot_SC.cpp b/src/AoeLoot_SC.cpp index cd31688..f65a09b 100644 --- a/src/AoeLoot_SC.cpp +++ b/src/AoeLoot_SC.cpp @@ -53,17 +53,15 @@ public: if (!_enable) return; - std::list deadCreatures; - float range = sConfigMgr->GetOption("AOELoot.Range", 30.0); + std::list deadCreatures; uint32 gold = 0; - player->GetDeadCreatureListInGrid(deadCreatures, range); + ObjectGuid lootGuid = player->GetLootGUID(); for (auto& _creature : deadCreatures) { - ObjectGuid lootGuid = player->GetLootGUID(); Loot* loot = &_creature->loot; gold += loot->gold; loot->gold = 0; @@ -82,6 +80,10 @@ public: player->SendItemRetrievalMail(lootItem->itemid, lootItem->count); } + else + { + player->SendLootRelease(lootGuid); + } } if (loot->isLooted())