forked from Minetest/dynamic_liquid
apparently this helps Lua's garbage collection, it was possible to blow Lua's memory budget by flying very fast but this fixes that.
parent
151d2e034b
commit
572329cfc6
6
init.lua
6
init.lua
|
@ -129,6 +129,8 @@ if not springs then
|
||||||
end
|
end
|
||||||
minetest.register_node("dynamic_liquid:clay", clay_def)
|
minetest.register_node("dynamic_liquid:clay", clay_def)
|
||||||
|
|
||||||
|
local data = {}
|
||||||
|
|
||||||
if springs then
|
if springs then
|
||||||
local c_clay = minetest.get_content_id("default:clay")
|
local c_clay = minetest.get_content_id("default:clay")
|
||||||
local c_spring_clay = minetest.get_content_id("dynamic_liquid:clay")
|
local c_spring_clay = minetest.get_content_id("dynamic_liquid:clay")
|
||||||
|
@ -140,7 +142,7 @@ if springs then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
|
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
|
for voxelpos, voxeldata in pairs(data) do
|
||||||
if voxeldata == c_clay then
|
if voxeldata == c_clay then
|
||||||
|
@ -148,7 +150,7 @@ if springs then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
vm:set_data(data)
|
vm:set_data(data)
|
||||||
vm:write_to_map()
|
vm:write_to_map()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
|
|
Loading…
Reference in New Issue