}
/******************************************************************************/
-ContentFeatures read_content_features(lua_State *L, int index)
+void read_content_features(lua_State *L, ContentFeatures &f, int index)
{
if(index < 0)
index = lua_gettop(L) + 1 + index;
- ContentFeatures f;
-
/* Cache existence of some callbacks */
lua_getfield(L, index, "on_construct");
if(!lua_isnil(L, -1)) f.has_on_construct = true;
getstringfield(L, index, "node_dig_prediction",
f.node_dig_prediction);
- return f;
}
void push_content_features(lua_State *L, const ContentFeatures &c)
extern struct EnumString es_TileAnimationType[];
-ContentFeatures read_content_features (lua_State *L, int index);
+void read_content_features (lua_State *L, ContentFeatures &f,
+ int index);
void push_content_features (lua_State *L,
const ContentFeatures &c);
// Read the node definition (content features) and register it
if (def.type == ITEM_NODE) {
- ContentFeatures f = read_content_features(L, table);
+ ContentFeatures f;
+ read_content_features(L, f, table);
// when a mod reregisters ignore, only texture changes and such should
// be done
if (f.name == "ignore")