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

Function get_int_field

plugins/burrow.cpp:234–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234static bool get_int_field(lua_State *L, int idx, const char *name, int16_t *dest) {
235 lua_getfield(L, idx, name);
236 if (lua_isnil(L, -1)) {
237 lua_pop(L, 1);
238 return false;
239 }
240 *dest = lua_tointeger(L, -1);
241 lua_pop(L, 1);
242 return true;
243}
244
245static bool get_bounds(lua_State *L, int idx, df::coord &pos1, df::coord &pos2) {
246 return get_int_field(L, idx, "x1", &pos1.x) &&

Callers 1

get_boundsFunction · 0.70

Calls 1

lua_getfieldFunction · 0.85

Tested by

no test coverage detected