diff options
author | kwolekr <kwolekr@minetest.net> | 2014-09-01 14:20:31 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2014-09-01 15:12:22 -0400 |
commit | 9e4e7072da8f565eef37da7558053a436b9cbba3 (patch) | |
tree | d1bb4ac82b4a25880695aec4df163dd0002cd526 /src/script/lua_api | |
parent | 3fa4f782d90dac0d800251a9ab0f0afb9d32560c (diff) | |
download | minetest-9e4e7072da8f565eef37da7558053a436b9cbba3.tar.gz minetest-9e4e7072da8f565eef37da7558053a436b9cbba3.tar.bz2 minetest-9e4e7072da8f565eef37da7558053a436b9cbba3.zip |
Update Mapgen VoxelManipulator on buffer invalidation
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_vmanip.cpp | 13 | ||||
-rw-r--r-- | src/script/lua_api/l_vmanip.h | 2 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index f3c1fa67a..2a3cfcafa 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -304,6 +304,18 @@ int LuaVoxelManip::l_update_map(lua_State *L) return 0; } +int LuaVoxelManip::l_was_modified(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + + LuaVoxelManip *o = checkobject(L, 1); + ManualMapVoxelManipulator *vm = o->vm; + + lua_pushboolean(L, vm->m_is_dirty); + + return 1; +} + LuaVoxelManip::LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool is_mg_vm) { this->vm = mmvm; @@ -396,5 +408,6 @@ const luaL_reg LuaVoxelManip::methods[] = { luamethod(LuaVoxelManip, set_light_data), luamethod(LuaVoxelManip, get_param2_data), luamethod(LuaVoxelManip, set_param2_data), + luamethod(LuaVoxelManip, was_modified), {0,0} }; diff --git a/src/script/lua_api/l_vmanip.h b/src/script/lua_api/l_vmanip.h index fc7ef30e6..70468b344 100644 --- a/src/script/lua_api/l_vmanip.h +++ b/src/script/lua_api/l_vmanip.h @@ -58,6 +58,8 @@ private: static int l_get_param2_data(lua_State *L); static int l_set_param2_data(lua_State *L); + static int l_was_modified(lua_State *L); + public: LuaVoxelManip(ManualMapVoxelManipulator *mmvm, bool is_mapgen_vm); LuaVoxelManip(Map *map); |