fix. Close the loot bag when taking the gold (#33)

This commit is contained in:
Walter Pagani
2024-03-11 21:18:26 -03:00
committed by GitHub
parent d777d183c5
commit 219d929324

View File

@@ -53,17 +53,15 @@ public:
if (!_enable)
return;
std::list<Creature*> deadCreatures;
float range = sConfigMgr->GetOption<float>("AOELoot.Range", 30.0);
std::list<Creature*> 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())