diff --git a/mods/ctf/ctf_map/ctf_map_core/init.lua b/mods/ctf/ctf_map/ctf_map_core/init.lua index ca88a73..df97149 100644 --- a/mods/ctf/ctf_map/ctf_map_core/init.lua +++ b/mods/ctf/ctf_map/ctf_map_core/init.lua @@ -10,7 +10,7 @@ end function ctf_map.file_exists(subdir, target) local list = minetest.get_dir_list(ctf_map.mapdir .. subdir, false) if type(target) == "string" then - return table.indexof(list, target) ~= 1 + return table.indexof(list, target) ~= -1 elseif type(target) == "table" then for _, filename in pairs(target) do if table.indexof(list, filename) == -1 then diff --git a/mods/ctf/ctf_map/ctf_map_core/maps_catalog.lua b/mods/ctf/ctf_map/ctf_map_core/maps_catalog.lua index 30b07d5..11f2ea3 100644 --- a/mods/ctf/ctf_map/ctf_map_core/maps_catalog.lua +++ b/mods/ctf/ctf_map/ctf_map_core/maps_catalog.lua @@ -50,9 +50,9 @@ local function show_catalog(name) -- Display screenshot if present, and move other elements down local y = 1 if ctf_map.file_exists(map.dirname, "screenshot.png") then - -- Check for mapdir .. "/screenshot.png", but pass in the texture - -- name, which would've been renamed to mapdir .. ".png" - fs = fs .. "image[4,1.5;6.5,3.5;" .. map.dirname .. ".png" .. "]" + -- Check for mapdir .. "/screenshot.png", but pass in the texture name, + -- which would've been renamed to "_screenshot.png" + fs = fs .. "image[4,1.5;6.5,3.5;" .. map.dirname .. "_screenshot.png" .. "]" y = y + 3.5 end diff --git a/setup_maps.sh b/setup_maps.sh index 1322c95..283f188 100755 --- a/setup_maps.sh +++ b/setup_maps.sh @@ -5,7 +5,7 @@ for f in *; do if [ -d ${f} ]; then # Screenshot if [ -f ${f}/screenshot.png ]; then - cp ${f}/screenshot.png ../textures/${f}.png + cp ${f}/screenshot.png ../textures/${f}_screenshot.png fi # Skybox textures