mirror of
https://github.com/azerothcore/mod-aoe-loot
synced 2025-11-29 21:38:16 +08:00
fix. Close the loot bag when taking the gold (#33)
This commit is contained in:
@@ -53,17 +53,15 @@ public:
|
|||||||
if (!_enable)
|
if (!_enable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::list<Creature*> deadCreatures;
|
|
||||||
|
|
||||||
float range = sConfigMgr->GetOption<float>("AOELoot.Range", 30.0);
|
float range = sConfigMgr->GetOption<float>("AOELoot.Range", 30.0);
|
||||||
|
|
||||||
|
std::list<Creature*> deadCreatures;
|
||||||
uint32 gold = 0;
|
uint32 gold = 0;
|
||||||
|
|
||||||
player->GetDeadCreatureListInGrid(deadCreatures, range);
|
player->GetDeadCreatureListInGrid(deadCreatures, range);
|
||||||
|
ObjectGuid lootGuid = player->GetLootGUID();
|
||||||
|
|
||||||
for (auto& _creature : deadCreatures)
|
for (auto& _creature : deadCreatures)
|
||||||
{
|
{
|
||||||
ObjectGuid lootGuid = player->GetLootGUID();
|
|
||||||
Loot* loot = &_creature->loot;
|
Loot* loot = &_creature->loot;
|
||||||
gold += loot->gold;
|
gold += loot->gold;
|
||||||
loot->gold = 0;
|
loot->gold = 0;
|
||||||
@@ -82,6 +80,10 @@ public:
|
|||||||
|
|
||||||
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
|
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->SendLootRelease(lootGuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (loot->isLooted())
|
if (loot->isLooted())
|
||||||
|
|||||||
Reference in New Issue
Block a user