From 8e24e31c1581a6aeeaa64fa0a7b00c72a80664ec Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Sat, 5 Jun 2021 07:13:19 -0700 Subject: [PATCH] Cleanup --- cgpsmap.lua | 2 +- init.lua | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cgpsmap.lua b/cgpsmap.lua index 736e29b..b3c2116 100644 --- a/cgpsmap.lua +++ b/cgpsmap.lua @@ -138,7 +138,7 @@ minetest.register_craftitem("compassgps:cgpsmap_marked", { e:setyaw(yaw) local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z) if growing_wall_maps == false then - e:set_properties({visual_size={x=0.85,y=0.85}}) + e:set_properties({visual_size={x=0.85,y=0.85}}) elseif dist>30000 then e:set_properties({visual_size={x=3.45,y=3.45}}) elseif dist>15000 then diff --git a/init.lua b/init.lua index da45103..b4ac039 100644 --- a/init.lua +++ b/init.lua @@ -60,12 +60,12 @@ local file = io.open(minetest.get_worldpath().."/bookmarks", "r") if file then bookmarks = minetest.deserialize(file:read("*all")) -- check if it was an empty file because empty files can crash server - if bookmarks == nil then + if bookmarks == nil then print("compassgps:ERROR:bookmarks file exists but is empty, will recreate") print("compassgps: this will stop the server from crashing, but bookmarks are lost") print("compassgps: please restore "..minetest.get_worldpath().."/bookmarks from a backup if possible") bookmarks = { } - end + end file:close() end @@ -140,10 +140,10 @@ local file = io.open(minetest.get_worldpath().."/compassgps_settings", "r") if file then settings = minetest.deserialize(file:read("*all")) -- check if it was an empty file because empty files can crash server - if settings == nil then + if settings == nil then print("compassgps:ERROR:compassgps_setting file exists but is empty, will recreate") settings = { } - end + end file:close() end --now transfer these to the correct variables @@ -1244,7 +1244,7 @@ function compassgps.get_compassgps_formspec(name) "textlist[0,3.0;8.8,6;bookmark_list;"..list..";"..bkmrkidx.."]".. "button[0,9.3;3.3,1;find_bookmark;"..S("Show selected bookmark").."]".. telebutton - + end --get_compassgps_formspec