Skip to content

Commit

Permalink
[CSM] Fix crash when the minimap is disabled. Caused by e25a38e
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallJoker committed May 20, 2017
1 parent 1469424 commit 673ac55
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clientmods/preview/init.lua
Expand Up @@ -78,6 +78,10 @@ core.register_chatcommand("test_node", {

local function preview_minimap()
local minimap = core.ui.minimap
if not minimap then
print("[PREVIEW] Minimap is disabled. Skipping.")
return
end
minimap:set_mode(4)
minimap:show()
minimap:set_pos({x=5, y=50, z=5})
Expand All @@ -96,7 +100,9 @@ core.after(2, function()
end)

core.after(5, function()
core.ui.minimap:show()
if core.ui.minimap then
core.ui.minimap:show()
end

print("[PREVIEW] Day count: " .. core.get_day_count() ..
" time of day " .. core.get_timeofday())
Expand Down

0 comments on commit 673ac55

Please sign in to comment.