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

Function fetch_container_details

library/LuaWrapper.cpp:241–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239}
240
241static void fetch_container_details(lua_State *state, int meta, const type_identity **pitem, int *pcount)
242{
243 if (!meta) return;
244
245 lua_getfield(state, meta, "_field_identity");
246 *pitem = (type_identity*)lua_touserdata(state, -1);
247 lua_pop(state, 1);
248
249 if (pcount)
250 {
251 lua_getfield(state, meta, "_count");
252 if (lua_isnumber(state, -1))
253 *pcount = lua_tointeger(state, -1);
254 lua_pop(state, 1);
255 }
256}
257
258/**
259 * Check if type1 and type2 are compatible, possibly using additional metatable data.

Callers 2

is_type_compatibleMethod · 0.85
meta_sizeofFunction · 0.85

Calls 3

lua_getfieldFunction · 0.85
lua_touserdataFunction · 0.85
lua_isnumberFunction · 0.85

Tested by

no test coverage detected