Skip to content

Commit 6c78381

Browse files
committed
Map code bugfixes
1 parent 8c463bc commit 6c78381

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

mods/ctf/ctf_map/map_functions.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ local ID_WATER = minetest.get_content_id("default:water_source")
6161
---@param mapmeta table Map meta table
6262
---@param callback function
6363
function ctf_map.remove_barrier(mapmeta, callback)
64-
local pos1, pos2 = mapmeta.barrier_area.pos1, mapmeta.barrier_area.pos2
65-
6664
if not mapmeta.barriers then
65+
minetest.log("action", "Clearing barriers using mapmeta.barrier_area")
66+
67+
local pos1, pos2 = mapmeta.barrier_area.pos1, mapmeta.barrier_area.pos2
68+
6769
local vm = VoxelManip(pos1, pos2)
6870
local data = vm:get_data()
6971

@@ -112,7 +114,7 @@ function ctf_map.remove_barrier(mapmeta, callback)
112114
end
113115

114116
minetest.after(i - 0.04, function()
115-
local vm = VoxelManip(pos1, pos2)
117+
local vm = VoxelManip(mapmeta.pos1, mapmeta.pos2)
116118
vm:update_liquids()
117119

118120
callback()

mods/ctf/ctf_map/map_meta.lua

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ function ctf_map.load_map_meta(idx, dirname)
188188

189189
map.barriers = barriers
190190
else
191-
if ctf_core.settings.server_mode ~= "mapedit" then
192-
assert(false, "Map "..dirname.." has a corrupted barriers file. Re-save map to fix")
193-
end
194-
195191
minetest.log("error", "Map "..dirname.." has a corrupted barriers file. Re-save map to fix")
196192
end
197193
else
@@ -334,8 +330,6 @@ function ctf_map.save_map(mapmeta)
334330
end
335331
end
336332

337-
barrier_area.pos1 = vector.subtract(barrier_area.pos1, mapmeta.offset)
338-
339333
meta:set("map_version" , CURRENT_MAP_VERSION)
340334
meta:set("size" , minetest.serialize(vector.subtract(mapmeta.pos2, mapmeta.pos1)))
341335
meta:set("enabled" , mapmeta.enabled and "true" or "false")

mods/ctf/ctf_map/maps

Submodule maps updated 60 files

0 commit comments

Comments
 (0)