Add ability to disable maps
This commit is contained in:
parent
6b657ceff6
commit
919edf0aee
2 changed files with 9 additions and 2 deletions
|
@ -69,7 +69,14 @@ local function search_for_maps()
|
||||||
|
|
||||||
ctf_map.available_maps = {}
|
ctf_map.available_maps = {}
|
||||||
for key, _ in pairs(files_hash) do
|
for key, _ in pairs(files_hash) do
|
||||||
table.insert(ctf_map.available_maps, key)
|
local conf = Settings(mapdir .. "/" .. key .. ".conf")
|
||||||
|
minetest.log("error", "ctf.maps." .. key:gsub("%./", ""):gsub("/", "."))
|
||||||
|
if not conf:get_bool("disabled", false) and
|
||||||
|
minetest.settings:get_bool("ctf.maps." .. key:gsub("%./", ""):gsub("/", "."), true) then
|
||||||
|
table.insert(ctf_map.available_maps, key)
|
||||||
|
else
|
||||||
|
minetest.log("error", key .. " disabled!")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if next(ctf_map.available_maps) == nil then
|
if next(ctf_map.available_maps) == nil then
|
||||||
error("No maps found in directory " .. mapdir)
|
error("No maps found in directory " .. mapdir)
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit d341978b909b9fad5133c288e01930ffeaf9a9be
|
Subproject commit 48f309ee1da5d84df3c4c3da0d219de2f4a3c450
|
Loading…
Reference in a new issue