aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortobmaps <spambot42@yandex.ru>2011-05-11 20:39:26 +0700
committertobmaps <spambot42@yandex.ru>2011-05-11 20:39:26 +0700
commit78362a325f545cccf73622f2938cc5ea2a5d5799 (patch)
tree5872e5b06ab5bd45a56a31828523458443cd3612 /src
parent275c4d11ad34e27cbd541cd26b134fdd433f2a51 (diff)
Core/Loot: Pickpocketed and player corpse looted money shouldn't be shared among party members
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/LootHandler.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
index c19045f55ce..aacfd226fc5 100755
--- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp
@@ -104,6 +104,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
return;
Loot *pLoot = NULL;
+ bool shareMoney = true;
switch(GUID_HIPART(guid))
{
@@ -122,14 +123,20 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
Corpse *bones = ObjectAccessor::GetCorpse(*GetPlayer(), guid);
if (bones && bones->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
+ {
pLoot = &bones->loot;
+ shareMoney = false;
+ }
break;
}
case HIGHGUID_ITEM:
{
if (Item *item = GetPlayer()->GetItemByGuid(guid))
+ {
pLoot = &item->loot;
+ shareMoney = false;
+ }
break;
}
case HIGHGUID_UNIT:
@@ -139,7 +146,11 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed);
if (ok_loot && pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE))
+ {
pLoot = &pCreature->loot ;
+ if (pCreature->isAlive())
+ shareMoney = false;
+ }
break;
}
@@ -149,7 +160,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/)
if (pLoot)
{
- if (!IS_ITEM_GUID(guid) && player->GetGroup()) //item can be looted only single player
+ if (shareMoney && player->GetGroup()) //item, pickpocket and players can be looted only single player
{
Group *group = player->GetGroup();