Skip to content

Commit

Permalink
fix. Close the loot bag when taking the gold
Browse files Browse the repository at this point in the history
  • Loading branch information
pangolp committed Mar 12, 2024
1 parent d777d18 commit 755afb8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/AoeLoot_SC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,15 @@ class AoeLoot_Player : public PlayerScript
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;
Expand All @@ -82,6 +80,10 @@ class AoeLoot_Player : public PlayerScript

player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
}
else
{
player->SendLootRelease(lootGuid);
}
}

if (loot->isLooted())
Expand Down

0 comments on commit 755afb8

Please sign in to comment.