biomegen fixes #2

Merged
cora merged 2 commits from biomegen into master 2022-05-21 17:02:46 +02:00
2 changed files with 5 additions and 3 deletions

View File

@ -31,6 +31,8 @@ multi_map.generators = {}
-- When no suitable generator is found, this generator is used as a fallback
multi_map.fallback_generator = nil
local use_biomegen = biomegen and minetest.settings:get_bool("multi_map_use_biomegen",true)
local vm_data = {} -- reuse the massive VoxelManip memory buffer instead of creating on every on_generate()
-- Set the current layer which the mapgen is generating
@ -394,7 +396,7 @@ minetest.register_on_generated(function(minp, maxp,seed)
else
for i,f in ipairs(t) do
f.generator(multi_map.current_layer, vm, area, vm_data, minp, maxp, offset_minp, offset_maxp, f.arguments,seed)
if biomegen and ( not f.arguments or ( f.arguments and not f.arguments.nobiomoes ) ) then
if use_biomegen and ( not f.arguments or ( f.arguments and not f.arguments.nobiomoes ) ) then
biomegen.generate_all(vm_data, area, vm, minp, maxp, seed)
end
end

View File

@ -21,8 +21,8 @@ minetest.register_on_joinplayer(function(player)
end)
minetest.register_on_leaveplayer(function(player)
if multi_map.hud.enabled and player_huds[player:get_player_name()] then
player_huds[player:get_player_name()] = nil
if multi_map.hud.enabled and saved_huds[player:get_player_name()] then
saved_huds[player:get_player_name()] = nil
end
end)