benilla-re systems structs docs

Script::ContainerIDToInventoryID

function · ui · primitive

Address
0x4f94e0 · 124 bytes, up to 0x4f955b
Signature
int __fastcall (lua_State *L)
Meaning
Maps a container id to an inventory slot: id + 19 below 5, id + 59 from 5
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/bags#container-ids

Finding: Container ids in ui: bags and bag slots

ContainerIDToInventoryID(id) is 0x4f94e0. A non-number raises Usage: ContainerIDToInventoryID(containerID). Otherwise the id is truncated toward zero and reduced by 1; a result below 4 (signed) gets 20 added, any other 60. So ids 1 to 4 give 20 to 23, ids 5 to 10 give 64 to 69, the backpack 0 gives 19 and the keyring -2 gives 17; any other id n gives n + 19 (n at most 4) or n + 59 (n at least 5). Nothing is range checked. It returns one number.

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 5

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