Fix compatibility with 5.4

This commit is contained in:
kay27 2022-02-19 17:23:10 +04:00
parent cc064636a9
commit 18c815fbf1
2 changed files with 10 additions and 5 deletions

View File

@ -20,7 +20,7 @@ local function unsigned(v)
return v % 0x100000000
end
if not bit then
if bit == nil then
bit = {}
function bit.bxor(a, b)
local a = unsigned(a)
@ -38,8 +38,14 @@ if not bit then
end
end
if not vector.metatable then
dofile(minetest.get_modpath(minetest.get_current_modname() .. "/vector.lua"))
if vector.metatable == nil then
function math.round(x)
if x >= 0 then
return math.floor(x + 0.5)
end
return math.ceil(x - 0.5)
end
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/vector.lua")
end
-- End of compatibility stuff

View File

@ -436,8 +436,7 @@ local function build_a_village(minp, maxp, pr, placer)
end
-- Disable natural generation in singlenode.
if mg_name ~= "singlenode" then
local mg_name = minetest.get_mapgen_setting("mg_name")
if mcl_mapgen.name ~= "singlenode" then
local scan_last_node = mcl_mapgen.LAST_BLOCK * mcl_mapgen.BS - 1
local scan_offset = mcl_mapgen.BS
mcl_mapgen.register_mapgen(function(minp, maxp, chunkseed)