mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Core/Loot: Fix group loot if player loot recipient disconnects
Fixes #13300
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user