mirror of
https://github.com/brighton-chi/mod-aoe-loot.git
synced 2026-02-07 20:51:10 +00:00
Update aoe_loot.cpp
This commit is contained in:
@@ -25,7 +25,7 @@ bool AOELootServer::CanPacketReceive(WorldSession* session, WorldPacket& packet)
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
Player* player = session->GetPlayer();
|
Player* player = session->GetPlayer();
|
||||||
|
|
||||||
if (player->GetGroup() && !sConfigMgr->GetOption<bool>("AOELoot.Group", true))
|
if (player->GetGroup() && !sConfigMgr->GetOption<bool>("AOELoot.Group", true))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
@@ -40,6 +40,10 @@ bool AOELootServer::CanPacketReceive(WorldSession* session, WorldPacket& packet)
|
|||||||
for (auto* creature : lootcreature)
|
for (auto* creature : lootcreature)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (creature->GetGUID() == mainGuid)
|
||||||
|
{
|
||||||
|
continue; // Skip AOE loot for the main mob
|
||||||
|
}
|
||||||
if (!player->GetMap()->Instanceable() && !player->isAllowedToLoot(creature))
|
if (!player->GetMap()->Instanceable() && !player->isAllowedToLoot(creature))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -79,13 +83,12 @@ bool AOELootServer::CanPacketReceive(WorldSession* session, WorldPacket& packet)
|
|||||||
WorldPacket moneyPacket(CMSG_LOOT_MONEY, 0); // Create a dummy packet
|
WorldPacket moneyPacket(CMSG_LOOT_MONEY, 0); // Create a dummy packet
|
||||||
session->HandleLootMoneyOpcode(moneyPacket);
|
session->HandleLootMoneyOpcode(moneyPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!loot->empty())
|
if (loot->empty())
|
||||||
{
|
{
|
||||||
creature->loot.clear();
|
|
||||||
creature->AllLootRemovedFromCorpse();
|
creature->AllLootRemovedFromCorpse();
|
||||||
creature->RemoveDynamicFlag(UNIT_DYNFLAG_LOOTABLE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user