diff --git a/src/game/Loot/LootHandler.cpp b/src/game/Loot/LootHandler.cpp index f2c15894a1..575e9c1f14 100644 --- a/src/game/Loot/LootHandler.cpp +++ b/src/game/Loot/LootHandler.cpp @@ -70,6 +70,10 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recv_data) if (Item* item = _player->GetItemByGuid(lguid)) item->SetLootState(ITEM_LOOT_CHANGED); } + + if (loot->IsLootedFor(_player)) { + loot->Release(_player); + } } void WorldSession::HandleLootMoneyOpcode(WorldPacket& /*recv_data*/) diff --git a/src/game/Loot/LootMgr.cpp b/src/game/Loot/LootMgr.cpp index ae9b452be4..7eb26d14d0 100644 --- a/src/game/Loot/LootMgr.cpp +++ b/src/game/Loot/LootMgr.cpp @@ -1520,20 +1520,23 @@ void Loot::GroupCheck() masterLooter = player; } + if (masterLooter) + break; + // check if there is need to launch a roll for (auto lootItem : m_lootItems) { - if (!lootItem->isBlocked) - continue; + if (!lootItem->isBlocked) + continue; - uint32 itemSlot = lootItem->lootSlot; + uint32 itemSlot = lootItem->lootSlot; - if (m_roll.find(itemSlot) == m_roll.end() && lootItem->IsAllowed(player, this)) - { - if (!m_roll[itemSlot].TryToStart(*this, itemSlot)) // Create and try to start a roll - m_roll.erase(m_roll.find(itemSlot)); // Cannot start roll so we have to delete it (find will not fail as the item was just created) - } - } + if (m_roll.find(itemSlot) == m_roll.end() && lootItem->IsAllowed(player, this)) + { + if (!m_roll[itemSlot].TryToStart(*this, itemSlot)) // Create and try to start a roll + m_roll.erase(m_roll.find(itemSlot)); // Cannot start roll so we have to delete it (find will not fail as the item was just created) + } + } } // in master loot case we have to send looter list to client