]> git.lizzy.rs Git - minetest.git/blobdiff - builtin/game/misc_s.lua
Add callback on_mapblocks_changed
[minetest.git] / builtin / game / misc_s.lua
index 67a0ec684bcc484b5bc35497ef8ac2a4b4920766..93d2bafa8d79acd455ba6768069eed87c30e5b1d 100644 (file)
@@ -8,10 +8,9 @@
 -- Misc. API functions
 --
 
+-- This must match the implementation in src/script/common/c_converter.h
 function core.hash_node_position(pos)
-       return (pos.z + 32768) * 65536 * 65536
-                + (pos.y + 32768) * 65536
-                +  pos.x + 32768
+       return (pos.z + 0x8000) * 0x100000000 + (pos.y + 0x8000) * 0x10000 + (pos.x + 0x8000)
 end