Add debug setting to simplify editing the tutorial map

Set "tutorial_debug_map_editing = true" in minetest.conf

Disables grass layer and other stuff not part of the schematic
master
Wuzzy 2018-09-27 20:25:57 +02:00
parent f38fd26140
commit 34b8e3ea1f
1 changed files with 32 additions and 25 deletions

View File

@ -1,4 +1,11 @@
-- TUTORIAL MAP GENERATION
-- == DEBUG SETTINGS ==
-- If true, the generated tutorial map is in "map editing" mode, only generating
-- the raw castle, no grass layer or other random decorations will be generated
local map_editing = minetest.settings:get_bool("tutorial_debug_map_editing")
-- == END OF DEBUG SETTINGS ==
-- Directory where the map data will be stored
tutorial.map_directory = minetest.get_modpath("tutorial").."/mapdata/"
@ -333,14 +340,14 @@ minetest.register_on_generated(function(minp, maxp, seed)
end
end
-- Make grass
-- Generate a layer of grass for the outside area
if map_editing ~= true then
local grasslev = 0
if minp.y <= grasslev and maxp.y >= grasslev then
local vdata = vm:get_data(vbuffer)
local area = VoxelArea:new({MinEdge=emin, MaxEdge=emax})
local c_dirt_with_grass = minetest.get_content_id("default:dirt_with_grass")
local c_grass = minetest.get_content_id("default:grass_5")
local c_dirt = minetest.get_content_id("default:dirt_with_grass")
for x = minp.x, maxp.x do
for z = minp.z, maxp.z do
local p_pos = area:index(x, grasslev, z)
@ -364,7 +371,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
vm:set_data(vdata)
state_changed = true
end
end
if(state_changed) then
vm:calc_lighting(nil, nil, false)