Fix "attempt to index a nil value"

multi_map settings like number_of_layers must be finalized before invoking mmgen_*.lua files, as they invoke multi_map.register_global_2dmap() which create an array of global_2d_params - one for each layer.
This commit is contained in:
Treer 2019-02-09 12:30:27 +11:00
parent adb42fa270
commit cf66603d61
1 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,10 @@
local multi_map_generators_path = minetest.get_modpath("multi_map_generators") local multi_map_generators_path = minetest.get_modpath("multi_map_generators")
multi_map.number_of_layers = 38
multi_map.layers_start_chunk = 0
multi_map.layer_height_chunks = 20
--multi_map.wrap_layers = true
dofile(multi_map_generators_path.."/mmgen_levels.lua") dofile(multi_map_generators_path.."/mmgen_levels.lua")
--dofile(multi_map_generators_path.."/mmgen_lvm_example.lua") --dofile(multi_map_generators_path.."/mmgen_lvm_example.lua")
dofile(multi_map_generators_path.."/mmgen_simple.lua") dofile(multi_map_generators_path.."/mmgen_simple.lua")
@ -13,11 +18,6 @@ dofile(multi_map_generators_path.."/mmgen_testauri.lua")
--multi_map.register_generator(12, mmgen_testauri.generate) --multi_map.register_generator(12, mmgen_testauri.generate)
--multi_map.register_generator(13, mmgen_levels.generate) --multi_map.register_generator(13, mmgen_levels.generate)
multi_map.number_of_layers = 38
multi_map.layers_start_chunk = 0
multi_map.layer_height_chunks = 20
--multi_map.wrap_layers = true
multi_map.register_fallback_generator(mmgen_simple.generate) multi_map.register_fallback_generator(mmgen_simple.generate)
--multi_map.register_generator(18, mmgen_testauri.generate) --multi_map.register_generator(18, mmgen_testauri.generate)