diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-31 13:50:25 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-31 13:50:25 +0300 |
commit | dc70f50b5901732f928c439060dcbbcc6a5dfeb7 (patch) | |
tree | f1f69273b321476124023832b70ef9bd15b3d5ee /src/scriptapi.cpp | |
parent | e297c739139ad0116ebdcda7a8dc5884d89f5a96 (diff) | |
download | minetest-dc70f50b5901732f928c439060dcbbcc6a5dfeb7.tar.gz minetest-dc70f50b5901732f928c439060dcbbcc6a5dfeb7.tar.bz2 minetest-dc70f50b5901732f928c439060dcbbcc6a5dfeb7.zip |
initial_properties field in entity definition
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r-- | src/scriptapi.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index 4ca114a0c..a9f54627d 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -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) |