benilla-re systems structs docs

GetScriptFlagArg

function · ui · primitive

Address
0x6f1c10 · 213 bytes, up to 0x6f1ce4
Signature
int32_t __fastcall (lua_State *L, int index, int32_t defaultValue)
Meaning
Reads a script argument as a flag: nil 0, boolean itself, number truncated whole, string by first letter or keyword
Confidence
verified, proof one
Finding
ui/actionuse#reading-a-script-flag

Finding: Reading a script flag in ui: placing, picking up and using actions

0x6f1c10(L, index, default) reads a Lua argument as a flag. A missing argument, a light userdata and a table, function, userdata or thread give the default. Nil gives 0. A boolean gives itself. A number gives the low 32 bits of its 64-bit truncation (0 for NaN, ±inf or ≥2^63), so 0.6 gives 0. A string gives 0 when its first character is 0, F, f, N or n, and 1 when it is 1 to 9, T, t, Y or y. Any other string is compared without case with off and disabled, giving 0, with on and enabled, giving 1, and otherwise gives the default. The string "0" is therefore false although every Lua 5.0 string is true.

The derivation is in the doc.

Callers 65

Callees 6

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