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

Function get_int_field

plugins/dig.cpp:2100–2109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2098}
2099
2100static bool get_int_field(lua_State *L, int idx, const char *name, int16_t *dest) {
2101 lua_getfield(L, idx, name);
2102 if (lua_isnil(L, -1)) {
2103 lua_pop(L, 1);
2104 return false;
2105 }
2106 *dest = lua_tointeger(L, -1);
2107 lua_pop(L, 1);
2108 return true;
2109}
2110
2111static bool get_bounds(lua_State *L, int idx, df::coord &pos1, df::coord &pos2) {
2112 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