Skip to content

Commit d838e4e

Browse files
committed
Fix crash when editing maps
1 parent a209df3 commit d838e4e

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mods/ctf/ctf_map/map_meta.lua

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ local CURRENT_MAP_VERSION = "3"
22

33
local modname = minetest.get_current_modname()
44

5+
local IS_RUNTIME = true
6+
minetest.after(0, function()
7+
IS_RUNTIME = false
8+
end)
9+
510
function ctf_map.skybox_exists(subdir)
611
local list = minetest.get_dir_list(subdir, true)
712

@@ -188,8 +193,8 @@ function ctf_map.load_map_meta(idx, dirname)
188193
if core.features.dynamic_add_media_startup then
189194
minetest.dynamic_add_media({
190195
filename = dirname .. "_" .. e,
191-
filepath = ctf_map.map_path[dirname] .. "/" .. e}
192-
)
196+
filepath = ctf_map.map_path[dirname] .. "/" .. e
197+
}, not IS_RUNTIME and function() end or nil)
193198
end
194199
end
195200
end
@@ -202,8 +207,8 @@ function ctf_map.load_map_meta(idx, dirname)
202207
if core.features.dynamic_add_media_startup then
203208
minetest.dynamic_add_media({
204209
filename = dirname .. e,
205-
filepath = ctf_map.map_path[dirname] .. "/skybox/" .. e}
206-
)
210+
filepath = ctf_map.map_path[dirname] .. "/skybox/" .. e
211+
}, not IS_RUNTIME and function() end or nil)
207212
end
208213
end
209214
end

0 commit comments

Comments
 (0)