1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

initial_properties field in entity definition

This commit is contained in:
Perttu Ahola 2012-03-31 13:50:25 +03:00
parent e297c73913
commit dc70f50b59
3 changed files with 22 additions and 13 deletions

View file

@ -4887,8 +4887,13 @@ void scriptapi_luaentity_get_properties(lua_State *L, u16 id,
// Set default values that differ from ObjectProperties defaults
prop->hp_max = 10;
// Read stuff
// Deprecated: read object properties directly
read_object_properties(L, -1, prop);
// Read initial_properties
lua_getfield(L, -1, "initial_properties");
read_object_properties(L, -1, prop);
lua_pop(L, 1);
}
void scriptapi_luaentity_step(lua_State *L, u16 id, float dtime)