diff options
author | SmallJoker <mk939@ymail.com> | 2017-05-20 10:12:37 +0200 |
---|---|---|
committer | SmallJoker <mk939@ymail.com> | 2017-05-20 10:26:09 +0200 |
commit | 673ac55a9db4728a6817e284196e7acdd8f3daaf (patch) | |
tree | c851326b3cb4273ac448a4ca015ca50633ac73b7 /clientmods | |
parent | 1469424075affce7c27bb44e5a5cbd51485e44b2 (diff) | |
download | minetest-673ac55a9db4728a6817e284196e7acdd8f3daaf.tar.gz minetest-673ac55a9db4728a6817e284196e7acdd8f3daaf.tar.bz2 minetest-673ac55a9db4728a6817e284196e7acdd8f3daaf.zip |
[CSM] Fix crash when the minimap is disabled. Caused by e25a38e
Diffstat (limited to 'clientmods')
-rw-r--r-- | clientmods/preview/init.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clientmods/preview/init.lua b/clientmods/preview/init.lua index 821f7c714..f3992612a 100644 --- a/clientmods/preview/init.lua +++ b/clientmods/preview/init.lua @@ -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}) @@ -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()) |