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

Function get_bool_field

plugins/burrow.cpp:218–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216//
217
218static void get_bool_field(lua_State *L, int idx, const char *name, bool *dest) {
219 lua_getfield(L, idx, name);
220 if (lua_isnil(L, -1)) {
221 lua_pop(L, 1);
222 return;
223 }
224 *dest = lua_toboolean(L, -1);
225 lua_pop(L, 1);
226}
227
228static void get_opts(lua_State *L, int idx, bool &zlevel) {
229 if (lua_gettop(L) < idx)

Callers 1

get_optsFunction · 0.70

Calls 2

lua_getfieldFunction · 0.85
lua_tobooleanFunction · 0.85

Tested by

no test coverage detected