fix(inventory): MoveItemInInventory moves only where the item belongs, as the client

LWOInventoryComponent_Common::msgMoveItemInInventory (0x00d20590) looks the
item up in the inventory the message names and moves it only to the
inventory its LOT belongs in (GetInventoryTypeForLOT 0x00c3c4f0), or for
the vaults (VAULT_ITEMS, VAULT_MODELS) the LOT's vault type
(GetValueTypeForLOT 0x00c3c4a0). An item in the target slot swaps into the
moved item's old slot and inventory, and must belong there. The server
moved an item into any inventory destInvType named and left the swapped
item in the destination. Live clients never set destInvType (0 of 61 in
the captures).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 10:26:20 -05:00
parent 7366799152
commit ba6228ef09
4 changed files with 179 additions and 23 deletions

View File

@@ -217,14 +217,6 @@ public:
*/
void MoveItemToInventory(Item* item, eInventoryType inventory, uint32_t count, bool showFlyingLot = true, bool isModMoveAndEquip = false, bool ignoreEquipped = false, int32_t preferredSlot = -1);
/**
* Moves a stack of items to an inventory
* @param item the item to move
* @param inventory the inventory to move the item to
* @param slot the slot in the inventory to move the item to
*/
void MoveStack(Item* item, eInventoryType inventory, uint32_t slot = 0);
/**
* Returns an item in the inventory by object ID
* @param id the id of the item to find
@@ -483,6 +475,13 @@ public:
*/
bool CanDelete(const Item& item) const;
void OnMoveItemInInventory(const GameMessages::MoveItemInInventory& msg);
/**
* The inventory an item of this LOT may be moved to within inventory (its own inventory, or for a vault the
* vault type), as the client finds it (GetInventoryTypeForLOT 0x00c3c4f0 / GetValueTypeForLOT 0x00c3c4a0).
* INVALID when the LOT has no vault.
*/
static eInventoryType GetInventoryTypeForMove(LOT lot, eInventoryType inventory);
void OnMoveItemBetweenInventoryTypes(const GameMessages::MoveItemBetweenInventoryTypes& msg);
// Answers the client at sysAddr with ResponseMoveItemBetweenInventoryTypes.
void OnRequestMoveItemBetweenInventoryTypes(const GameMessages::RequestMoveItemBetweenInventoryTypes& msg, const SystemAddress& sysAddr);