mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
[CSM] Fix crash when the minimap is disabled. Caused by e25a38e
This commit is contained in:
parent
1469424075
commit
673ac55a9d
@ -78,6 +78,10 @@ core.register_chatcommand("test_node", {
|
|||||||
|
|
||||||
local function preview_minimap()
|
local function preview_minimap()
|
||||||
local minimap = core.ui.minimap
|
local minimap = core.ui.minimap
|
||||||
|
if not minimap then
|
||||||
|
print("[PREVIEW] Minimap is disabled. Skipping.")
|
||||||
|
return
|
||||||
|
end
|
||||||
minimap:set_mode(4)
|
minimap:set_mode(4)
|
||||||
minimap:show()
|
minimap:show()
|
||||||
minimap:set_pos({x=5, y=50, z=5})
|
minimap:set_pos({x=5, y=50, z=5})
|
||||||
@ -96,7 +100,9 @@ core.after(2, function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
core.after(5, function()
|
core.after(5, function()
|
||||||
|
if core.ui.minimap then
|
||||||
core.ui.minimap:show()
|
core.ui.minimap:show()
|
||||||
|
end
|
||||||
|
|
||||||
print("[PREVIEW] Day count: " .. core.get_day_count() ..
|
print("[PREVIEW] Day count: " .. core.get_day_count() ..
|
||||||
" time of day " .. core.get_timeofday())
|
" time of day " .. core.get_timeofday())
|
||||||
|
Loading…
Reference in New Issue
Block a user