Made interactive loading optional but enabled by default

This commit is contained in:
Gaël C
2021-06-26 13:13:41 +02:00
parent 7e39189368
commit 32bc9561b6
5 changed files with 62 additions and 24 deletions

View File

@ -64,6 +64,9 @@ local loader_mt = {
function mapgen_rivers.interactive_loader(filename, bytes, signed, size, converter)
local file = io.open(worldpath .. filename, 'rb')
if file then
minetest.register_on_shutdown(function()
file:close()
end)
converter = converter or false
return setmetatable({file=file, bytes=bytes, signed=signed, size=size, conv=converter}, loader_mt)
end