mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Item): unlock openable item on the client when opened while dead (#27431)
Co-authored-by: Claude Fable 5.1 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
39ffb837d5
commit
9b7a65535b
@@ -211,13 +211,6 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
if (pUser->m_mover != pUser)
|
||||
return;
|
||||
|
||||
// xinef: additional check, client outputs message on its own
|
||||
if (!pUser->IsAlive())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, nullptr, nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
uint8 bagIndex, slot;
|
||||
|
||||
recvPacket >> bagIndex >> slot;
|
||||
@@ -231,6 +224,15 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
// The client locks the item when it sends CMSG_OPEN_ITEM and only unlocks it on a loot
|
||||
// response for that item's guid, so a plain equip error would leave it grayed out until /reload.
|
||||
if (!pUser->IsAlive())
|
||||
{
|
||||
pUser->SendEquipError(EQUIP_ERR_YOU_ARE_DEAD, item, nullptr);
|
||||
pUser->SendLootRelease(item->GetGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
ItemTemplate const* proto = item->GetTemplate();
|
||||
if (!proto)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user