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