From 572329cfc6b5193c483273191f9cddd0e8e45e2b Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Thu, 26 Jan 2017 23:12:06 -0700 Subject: [PATCH] apparently this helps Lua's garbage collection, it was possible to blow Lua's memory budget by flying very fast but this fixes that. --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index a7953f2..e35bb0f 100644 --- a/init.lua +++ b/init.lua @@ -129,6 +129,8 @@ if not springs then end minetest.register_node("dynamic_liquid:clay", clay_def) +local data = {} + if springs then local c_clay = minetest.get_content_id("default:clay") local c_spring_clay = minetest.get_content_id("dynamic_liquid:clay") @@ -140,7 +142,7 @@ if springs then return end local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") - local data = vm:get_data() + vm:get_data(data) for voxelpos, voxeldata in pairs(data) do if voxeldata == c_clay then @@ -148,7 +150,7 @@ if springs then end end vm:set_data(data) - vm:write_to_map() + vm:write_to_map() end) minetest.register_abm({