mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 01:05:28 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user