Script::PutItemInBackpack
function · ui · orchestration
- Address
0x4c8f70· 45 bytes, up to0x4c8f9c- Signature
int __fastcall (lua_State *L)- Meaning
- Drops the held item on the backpack through the bag worker, returning 1 or nil
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- 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.
| leg | when | does | returns |
|---|---|---|---|
| gates | no player, the control flag 0xb4b3e4 zero, or a bank bag slot with the bank closed | nothing | 0 |
| equip | the bag slot is empty or past the table | 0x4c7300(slot) | 0 |
| same | the held item is the destination bag | clear the cursor | 1 |
| empty | nothing held and no vendor preview | clear the cursor | 0 |
| back | held from this container, and the container is not the player or the source is backpack | clear the cursor | 1 |
| swap | held from the player's own bag slot (19 to 22), or the held item is a container | lock the target, send swap | 1 |
| split | a split count [0xb4b40c] is pending | send 0x10e with slot 0xff | 1 |
| store | otherwise | send 0x10b | 1 |
| buy | nothing held, a vendor preview (kind 5), a vendor open | send 0x1a3 with slot 0xff, clear | 0 |
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 3
- PutItemInBackpackWorker ui
- lua_pushnil lua
- lua_pushnumber lua
Calls and jumps by a bare address, from tables/calls.tsv.