Fix maps in a very lame way

This commit is contained in:
kay27 2022-02-19 06:52:51 +04:00
parent 957a831dbf
commit 17c30de74a
1 changed files with 9 additions and 3 deletions

View File

@ -140,16 +140,22 @@ function mcl_maps.create_map(pos)
return itemstack
end
local loading_maps = {}
function mcl_maps.load_map(id)
if id == "" or creating_maps[id] then
if id == "" or creating_maps[id] or loading_maps[id] then
return
end
local texture = "mcl_maps_map_texture_" .. id .. ".png"
if not loaded_maps[id] then
loaded_maps[id] = true
minetest.dynamic_add_media(map_textures_path .. texture, function() end)
loading_maps[id] = true
minetest.dynamic_add_media({filepath = map_textures_path .. texture, ephemeral = true}, function(player_name)
loaded_maps[id] = true
loading_maps[id] = nil
end)
return
end
return texture