MCPcopy Create free account
hub / github.com/DFHack/dfhack / get_bool_field

Function get_bool_field

library/LuaApi.cpp:223–232  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223static bool get_bool_field(lua_State *L, bool *pf, int idx, const char *name, bool defval) {
224 lua_getfield(L, idx, name);
225 bool nil = lua_isnil(L, -1);
226 if (nil)
227 *pf = defval;
228 else
229 *pf = lua_toboolean(L, -1);
230 lua_pop(L, 1);
231 return !nil;
232}
233
234static void decode_pen(lua_State *L, Pen &pen, int idx)
235{

Callers 1

decode_penFunction · 0.70

Calls 2

lua_getfieldFunction · 0.85
lua_tobooleanFunction · 0.85

Tested by

no test coverage detected