benilla-re systems structs docs

Script::CanInspect

function · ui · primitive

Address
0x48a1b0 · 348 bytes, up to 0x48a30b
Signature
int __fastcall (lua_State *L)
Meaning
Pushes 1 or nil; shows at most one error: 295 or 184 no object, 297 non-player or uncooperative, 125 past 10 yards
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/distancegates#caninspect
Test
ui::caninspect_dist2, ui::can_inspect_whole_difftest

Finding: CanInspect in ui: distance gates and range checks

CanInspect(unit) raises Usage: CanInspect(unit) unless the argument is a string or number. It resolves the token (0x515940), shows at most one error by the first test below that holds, then runs 0x4944a0 on the object (null for none). It pushes the number 1 for a true answer and nil for a false one, one value either way; 0x4944a0 repeats the tests, so the answer is false after any error.

test, in ordermessage
the token names no object and is not empty295 ERR_UNIT_NOT_FOUND
the token names no object and is empty184 ERR_GENERIC_NO_TARGET
the active player has no object, or the object's type word lacks the player bit, or the object is not the player's own and CanCooperate refuses it297 ERR_INVALID_INSPECT_TARGET
the squared distance exceeds 100; a NaN does not125 ERR_OUT_OF_RANGE

The derivation is in the doc.

Callers 0

None by a direct call or jump.

Callees 11

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