From 35da0ca3fecdfa7fdcfa93ff79518df7822685a8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Thu, 19 Jul 2018 22:16:48 +0100 Subject: [PATCH] Revert "Fix lighting glitches on LVM map caused by engine mapgen" This reverts commit ae8005a1f40adba733710888f4662e31957b8ed9. --- mods/ctf_map/schem_map.lua | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/mods/ctf_map/schem_map.lua b/mods/ctf_map/schem_map.lua index 92e20c4..21b0a18 100644 --- a/mods/ctf_map/schem_map.lua +++ b/mods/ctf_map/schem_map.lua @@ -1,4 +1,4 @@ -minetest.set_mapgen_params({mgname = "singlenode", flags = "nolight"}) +assert(minetest.get_mapgen_setting("mg_name") == "singlenode", "singlenode mapgen is required.") minetest.register_alias("mapgen_singlenode", "ctf_map:ignore") minetest.register_alias("ctf_map:flag", "air") @@ -23,6 +23,7 @@ minetest.register_alias("default:bush_leaves", "air") minetest.register_alias("default:bush_stem", "air") local max_r = 120 +local max_h = 150 local mapdir = minetest.get_modpath("ctf_map") .. "/maps/" ctf_map.map = nil @@ -74,25 +75,23 @@ minetest.register_chatcommand("maps_reload", { function ctf_map.place_map(map) local schempath = mapdir .. map.schematic - -- - -- Place schematic - -- + -------------------------------------------------- + -- LVM + local vm = minetest.get_voxel_manip(map.pos1, map.pos2) local res = minetest.place_schematic_on_vmanip(vm, map.pos1, schempath, map.rotation == "z" and "0" or "90") + assert(res) + vm:write_to_map() - -- - -- Create bases - -- + -------------------------------------------------- + for _, value in pairs(ctf_map.map.teams) do ctf_team_base.place(value.color, value.pos) end - -- - -- Place flags - -- local seed = minetest.get_mapgen_setting("seed") for _, chestzone in pairs(ctf_map.map.chests) do minetest.log("warning", "Placing " .. chestzone.n .. " chests from " .. @@ -101,9 +100,6 @@ function ctf_map.place_map(map) place_chests(chestzone.from, chestzone.to, seed, chestzone.n) end - -- - -- Wait then send map messages (avoids "X joined blue" spam) - -- minetest.after(2, function() local msg = "Map: " .. map.name .. " by " .. map.author if map.hint then @@ -136,7 +132,7 @@ function ctf_match.load_map_meta(idx, name) chests = {}, } - assert(map.r <= max_r) + assert(map.r <= max_r and map.h <= max_h) map.pos1 = vector.add(offset, { x = -map.r, y = -map.h / 2, z = -map.r }) map.pos2 = vector.add(offset, { x = map.r, y = map.h / 2, z = map.r })