natiny_script_to_bool
bool natiny_script_to_bool(NatinyScriptValue value);
Converts a value using Lua truth rules.
Parameters
| Name | Type | Description |
|---|---|---|
value |
NatinyScriptValue |
Value to test |
Returns
| Type | Description |
|---|---|
bool |
false for NATINY_SCRIPT_NIL and a false NATINY_SCRIPT_BOOL; true for every other value, including numeric zero |
Example
if (natiny_script_to_bool(natiny_script_get(script, "game.debug")))
enable_debug_output();