fix(inventory): deleting skips equipped items, as the client

LWOInventoryComponent_Common::DoRemoveItemFromInventory (0x00d1fb50)
passes over equipped items when the loot source is LOOT_SOURCE_DELETION.
The server deleted the item while it was still worn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 10:24:27 -05:00
parent 9497d20027
commit 7366799152
2 changed files with 21 additions and 0 deletions

View File

@@ -2236,6 +2236,9 @@ void InventoryComponent::OnRemoveItemFromInventory(const GameMessages::RemoveIte
const auto iStackCount = msg.iStackCount == 0 ? item->GetCount() : msg.iStackCount;
if (item->GetCount() < iStackCount) return;
// DoRemoveItemFromInventory (0x00d1fb50) skips equipped items when deleting
if (msg.eLootTypeSource == GeneralUtils::ToUnderlying(eLootSourceType::DELETION) && item->IsEquipped()) return;
if (msg.bConfirmed && !CanDelete(*item)) {
LOG("%llu tried to delete %llu (LOT %i), which its deletion restriction does not allow", m_Parent->GetObjectID(), item->GetId(), item->GetLot());
return;