From 8727cc77ebf464c0cfa1f96732fce555e79d85d8 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 26 Jan 2018 17:40:09 +0000 Subject: [PATCH] Fix middle barrier not being removed --- mods/ctf_map/barrier.lua | 10 ++++------ mods/ctf_map/schem_map.lua | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mods/ctf_map/barrier.lua b/mods/ctf_map/barrier.lua index d88ccb6..ead90a6 100644 --- a/mods/ctf_map/barrier.lua +++ b/mods/ctf_map/barrier.lua @@ -9,21 +9,19 @@ local c_water_f = minetest.get_content_id("default:water_flowing") local c_air = minetest.get_content_id("air") function ctf_map.remove_middle_barrier() - minetest.log("error", "Removing middle barrier!") - local r = ctf_map.map.r local h = ctf_map.map.h - local min = { + local min = vector.add(ctf_map.map.offset, { x = -r + 1, y = -h / 2, z = -1 - } - local max = { + }) + local max = vector.add(ctf_map.map.offset, { x = r - 1, y = h / 2, z = 1 - } + }) local vm = minetest.get_voxel_manip() local emin, emax = vm:read_from_map(min, max) diff --git a/mods/ctf_map/schem_map.lua b/mods/ctf_map/schem_map.lua index 33e15cb..b7951ec 100644 --- a/mods/ctf_map/schem_map.lua +++ b/mods/ctf_map/schem_map.lua @@ -57,7 +57,7 @@ function ctf_map.place_map(map) local seed = minetest.get_mapgen_setting("seed") for _, value in pairs(ctf_map.map.teams) do place_chests(value.chests.from, value.chests.to, seed, value.chests.n) - minetest.log("error", "Placing " .. value.chests.n .. " chests from " .. + minetest.log("info", "Placing " .. value.chests.n .. " chests from " .. minetest.pos_to_string(value.chests.from) .. " to ".. minetest.pos_to_string(value.chests.to)) @@ -89,6 +89,7 @@ function ctf_match.load_map_meta(idx, name) h = tonumber(meta:get("h")), teams = {}, initial_stuff = initial_stuff and initial_stuff:split(","), + offset = offset, } assert(map.r <= max_r)