diff options
author | kwolekr <kwolekr@minetest.net> | 2015-05-17 22:14:26 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-05-17 22:14:26 -0400 |
commit | 46684beec185d13f89c4a91aaa5dd2148ebb0273 (patch) | |
tree | 3e4115131b71f7f00a232a59bdb2c61a440cc513 /src/script/lua_api | |
parent | 4c9a8a91c4988b3567a38af622a3eb0d0ec19f6b (diff) | |
download | minetest-46684beec185d13f89c4a91aaa5dd2148ebb0273.tar.gz minetest-46684beec185d13f89c4a91aaa5dd2148ebb0273.tar.bz2 minetest-46684beec185d13f89c4a91aaa5dd2148ebb0273.zip |
Record MapBlock modification reasons as flags instead of strings
This improves performance of MapBlock::raiseModified by a factor of 6.
Also, clean up mapblock.h a bit and inline small functions.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_nodemeta.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/script/lua_api/l_nodemeta.cpp b/src/script/lua_api/l_nodemeta.cpp index 4f20e56f9..906cc3172 100644 --- a/src/script/lua_api/l_nodemeta.cpp +++ b/src/script/lua_api/l_nodemeta.cpp @@ -63,9 +63,10 @@ void NodeMetaRef::reportMetadataChange(NodeMetaRef *ref) ref->m_env->getMap().dispatchEvent(&event); // Set the block to be saved MapBlock *block = ref->m_env->getMap().getBlockNoCreateNoEx(blockpos); - if(block) + if (block) { block->raiseModified(MOD_STATE_WRITE_NEEDED, - "NodeMetaRef::reportMetadataChange"); + MOD_REASON_REPORT_META_CHANGE); + } } // Exported functions |