1
0
mirror of https://github.com/minetest/minetest.git synced 2025-06-30 23:20:22 +02:00

Pass ContentFeatures as reference to read_content_features (#10464)

This commit is contained in:
JosiahWI
2020-10-13 10:36:01 -05:00
committed by GitHub
parent d671102546
commit 11f3deb9c4
3 changed files with 5 additions and 6 deletions

View File

@ -491,13 +491,11 @@ TileDef read_tiledef(lua_State *L, int index, u8 drawtype)
}
/******************************************************************************/
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;
@ -800,7 +798,6 @@ ContentFeatures read_content_features(lua_State *L, int index)
getstringfield(L, index, "node_dig_prediction",
f.node_dig_prediction);
return f;
}
void push_content_features(lua_State *L, const ContentFeatures &c)