Script::CanInspect
function · ui · primitive
- Address
0x48a1b0· 348 bytes, up to0x48a30b- 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 order | message |
|---|---|
| the token names no object and is not empty | 295 ERR_UNIT_NOT_FOUND |
| the token names no object and is empty | 184 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 it | 297 ERR_INVALID_INSPECT_TARGET |
| the squared distance exceeds 100; a NaN does not | 125 ERR_OUT_OF_RANGE |
The derivation is in the doc.
Callers 0
None by a direct call or jump.
Callees 11
- ClntObjMgrObjectPtr objectlayer
- ClntObjMgrGetActivePlayer objectlayer
- CanReadUnitInventory ui
- CGGameUI::DisplayError ui
- GetUnitFromToken ui
- CGUnit_C::CanCooperate objectlayer
- lua_isstring lua
- lua_tostring lua
- lua_pushnil lua
- lua_pushnumber lua
- luaL_error lua
Calls and jumps by a bare address, from tables/calls.tsv.