benilla-re systems structs docs

CanReadUnitInventory

function · ui · primitive

Address
0x4944a0 · 168 bytes, up to 0x494547
Signature
bool __thiscall (CGUnit_C *this)
Meaning
Tells whether a player unit is the active player or a cooperative player within 10 yards
Confidence
verified, proof one
Finding
ui/inventory#item-counts
Test
ui::dist2_4944a0

Finding: Item counts in ui: inventory queries and alerts

GetInventoryItemCount(unit, slot) is 0x4c8680 and always returns one number. A first argument that is neither string nor number raises Usage: GetInventoryItemCount(unit, slot); a slot the reader refuses raises Invalid inventory slot in GetInventoryItemCount. The unit must resolve to a player the active player may read (itself, or a player it can cooperate with, 0x606ba0, within 10 yards, 0x4944a0); else the result is 1. So is an empty slot. An item that is not a container returns its stack count. Slot 0 (ammo) is read for the active player only, with PLAYER_AMMO_ID set: the total stack count of that ammo over the equipment, equipped bags, backpack, their contents and the keyring, not the bank; otherwise 1.

The derivation is in the doc.

Callers 8

Callees 3

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