forked from MineClone5/MineClone5
Fix maps in a very lame way
This commit is contained in:
parent
957a831dbf
commit
17c30de74a
|
@ -140,16 +140,22 @@ function mcl_maps.create_map(pos)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local loading_maps = {}
|
||||||
|
|
||||||
function mcl_maps.load_map(id)
|
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
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local texture = "mcl_maps_map_texture_" .. id .. ".png"
|
local texture = "mcl_maps_map_texture_" .. id .. ".png"
|
||||||
|
|
||||||
if not loaded_maps[id] then
|
if not loaded_maps[id] then
|
||||||
loaded_maps[id] = true
|
loading_maps[id] = true
|
||||||
minetest.dynamic_add_media(map_textures_path .. texture, function() end)
|
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
|
end
|
||||||
|
|
||||||
return texture
|
return texture
|
||||||
|
|
Loading…
Reference in New Issue