benilla-re systems structs docs

PutItemInContainer

function · ui · orchestration

Address
0x4c7c00 · 708 bytes, up to 0x4c7ec3
Signature
uint32_t __fastcall (uint32_t slot)
Meaning
Equips, swaps, splits, stores or buys into the bag at a slot from the cursor, returning 1 when consumed
Confidence
verified, proof one
Finding
ui/bags#putting-an-item-in-a-bag

Finding: Putting an item in a bag in ui: bags and bag slots

PutItemInBag(slot) is 0x4c8f00 and PutItemInBackpack() is 0x4c8f70; both return the number 1 or nil, from the worker 0x4c7c00(slot) (the backpack passes 0xff through the thunk 0x4c7ed0). The Lua slot goes through 0x4c8520 and must be at least 19 (0-based): a bad argument raises Invalid bag slot in PutItemInBag. There is no upper bound, so bank item and keyring slots pass. The worker returns 1 when the click was consumed against an existing container and 0 otherwise.

legwhendoesreturns
gatesno player, the control flag 0xb4b3e4 zero, or a bank bag slot with the bank closednothing0
equipthe bag slot is empty or past the table0x4c7300(slot)0
samethe held item is the destination bagclear the cursor1
emptynothing held and no vendor previewclear the cursor0
backheld from this container, and the container is not the player or the source is backpackclear the cursor1
swapheld from the player's own bag slot (19 to 22), or the held item is a containerlock the target, send swap1
splita split count [0xb4b40c] is pendingsend 0x10e with slot 0xff1
storeotherwisesend 0x10b1
buynothing held, a vendor preview (kind 5), a vendor opensend 0x1a3 with slot 0xff, clear0

The derivation is in the doc.

Callers 2

Callees 11

Calls and jumps by a bare address, from tables/calls.tsv.