Skip to content

Commit

Permalink
Map code bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWolfHT committed Sep 19, 2023
1 parent 8c463bc commit 6c78381
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
8 changes: 5 additions & 3 deletions mods/ctf/ctf_map/map_functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ local ID_WATER = minetest.get_content_id("default:water_source")
---@param mapmeta table Map meta table
---@param callback function
function ctf_map.remove_barrier(mapmeta, callback)
local pos1, pos2 = mapmeta.barrier_area.pos1, mapmeta.barrier_area.pos2

if not mapmeta.barriers then
minetest.log("action", "Clearing barriers using mapmeta.barrier_area")

local pos1, pos2 = mapmeta.barrier_area.pos1, mapmeta.barrier_area.pos2

local vm = VoxelManip(pos1, pos2)
local data = vm:get_data()

Expand Down Expand Up @@ -112,7 +114,7 @@ function ctf_map.remove_barrier(mapmeta, callback)
end

minetest.after(i - 0.04, function()
local vm = VoxelManip(pos1, pos2)
local vm = VoxelManip(mapmeta.pos1, mapmeta.pos2)
vm:update_liquids()

callback()
Expand Down
6 changes: 0 additions & 6 deletions mods/ctf/ctf_map/map_meta.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,6 @@ function ctf_map.load_map_meta(idx, dirname)

map.barriers = barriers
else
if ctf_core.settings.server_mode ~= "mapedit" then
assert(false, "Map "..dirname.." has a corrupted barriers file. Re-save map to fix")
end

minetest.log("error", "Map "..dirname.." has a corrupted barriers file. Re-save map to fix")
end
else
Expand Down Expand Up @@ -334,8 +330,6 @@ function ctf_map.save_map(mapmeta)
end
end

barrier_area.pos1 = vector.subtract(barrier_area.pos1, mapmeta.offset)

meta:set("map_version" , CURRENT_MAP_VERSION)
meta:set("size" , minetest.serialize(vector.subtract(mapmeta.pos2, mapmeta.pos1)))
meta:set("enabled" , mapmeta.enabled and "true" or "false")
Expand Down
2 changes: 1 addition & 1 deletion mods/ctf/ctf_map/maps
Submodule maps updated 60 files
+ abandoned_battlefield/barriers.data
+14 −14 abandoned_battlefield/map.conf
+ ahkmenrah_pyramids/barriers.data
+14 −14 ahkmenrah_pyramids/map.conf
+ ancient_pyramids/barriers.data
+14 −14 ancient_pyramids/map.conf
+ appleton/barriers.data
+14 −14 appleton/map.conf
+ big_ocean/barriers.data
+14 −14 big_ocean/map.conf
+ bridge/barriers.data
+14 −14 bridge/map.conf
+ capture_legend/barriers.data
+14 −14 capture_legend/map.conf
+ caverns/barriers.data
+14 −14 caverns/map.conf
+ coast/barriers.data
+14 −14 coast/map.conf
+ desert_spikes/barriers.data
+14 −14 desert_spikes/map.conf
+ dragons_dance/barriers.data
+14 −14 dragons_dance/map.conf
+ ewok_village/barriers.data
+14 −14 ewok_village/map.conf
+ green_hills/barriers.data
+14 −14 green_hills/map.conf
+ iceage/barriers.data
+14 −14 iceage/map.conf
+ lost_mountains/barriers.data
+14 −14 lost_mountains/map.conf
+ mayan_legend/barriers.data
+14 −14 mayan_legend/map.conf
+ nether_kingdom/barriers.data
+14 −14 nether_kingdom/map.conf
+ pirates_hideout/barriers.data
+14 −14 pirates_hideout/map.conf
+ plain_battle/barriers.data
+14 −14 plain_battle/map.conf
+ plains/barriers.data
+14 −14 plains/map.conf
+ race_day/barriers.data
+14 −14 race_day/map.conf
+ river_valley/barriers.data
+14 −14 river_valley/map.conf
+ sams_mansion/barriers.data
+14 −14 sams_mansion/map.conf
+ savanna_ravine/barriers.data
+14 −14 savanna_ravine/map.conf
+ skies_of_land/barriers.data
+14 −14 skies_of_land/map.conf
+ snowland/barriers.data
+14 −14 snowland/map.conf
+ the_wall/barriers.data
+14 −14 the_wall/map.conf
+ tunnel/barriers.data
+14 −14 tunnel/map.conf
+ two_hills/barriers.data
+14 −14 two_hills/map.conf
+ water_academy/barriers.data
+14 −14 water_academy/map.conf

0 comments on commit 6c78381

Please sign in to comment.