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:
Øyvind
2026-09-11 18:40:21 -03:00
committed by GitHub
co-authored by Claude Fable 5.1
parent 39ffb837d5
commit 9b7a65535b
+9 -7
View File
@@ -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)
{