Core/Loot: Fix group loot if player loot recipient disconnects

Fixes #13300
This commit is contained in:
jackpoz
2016-08-28 13:25:48 +02:00
committed by Ovahlord
parent d6e6750b67
commit ebaafd20cd

View File

@@ -8951,15 +8951,10 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
}
else
{
// the player whose group may loot the corpse
Player* recipient = creature->GetLootRecipient();
if (!recipient)
return;
if (loot->loot_type == LOOT_NONE)
{
// for creature, loot is filled when creature is killed.
if (Group* group = recipient->GetGroup())
if (Group* group = creature->GetLootRecipientGroup())
{
switch (group->GetLootMethod())
{
@@ -8995,9 +8990,10 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
// set group rights only for loot_type != LOOT_SKINNING
else
{
if (Group* group = GetGroup())
if (creature->GetLootRecipientGroup())
{
if (group == recipient->GetGroup())
Group* group = GetGroup();
if (group == creature->GetLootRecipientGroup())
{
switch (group->GetLootMethod())
{
@@ -9018,7 +9014,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
else
permission = NONE_PERMISSION;
}
else if (recipient == this)
else if (creature->GetLootRecipient() == this)
permission = OWNER_PERMISSION;
else
permission = NONE_PERMISSION;