diff --git a/.luacheckrc b/.luacheckrc index dd839e7..8293d58 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -30,3 +30,8 @@ read_globals = { } }, } +files["init.lua"] = { + globals = { + "cartographer", + } +}; diff --git a/init.lua b/init.lua index d69f041..1df584a 100644 --- a/init.lua +++ b/init.lua @@ -3,10 +3,6 @@ local mod_storage = minetest.get_mod_storage(); -- The path to this mod, for including files local modpath = minetest.get_modpath("cartographer"); --- The API object -cartographer = { -}; - local map_data = { generated = minetest.deserialize(mod_storage:get_string("map")) or {}, @@ -62,9 +58,12 @@ local map_item = loadfile(modpath .. "/items.lua") (chunk, marker_lookup, gui, s loadfile(modpath .. "/commands.lua") (chunk, audio, map_formspec); loadfile(modpath .. "/table.lua") (gui, skin, audio, maps, materials, map_item); -cartographer.skin = skin; -cartographer.biomes = biomes; -cartographer.markers = markers; -cartographer.maps = maps; -cartographer.map_item = map_item; -cartographer.materials = materials; +-- The API object +cartographer = { + skin = skin; + biomes = biomes; + markers = markers; + maps = maps; + map_item = map_item; + materials = materials; +}; diff --git a/map_formspec.lua b/map_formspec.lua index b8b2ccf..e66885a 100644 --- a/map_formspec.lua +++ b/map_formspec.lua @@ -193,7 +193,8 @@ function map_formspec.from_map(map, x, y, height_mode) w = formspec_width, h = formspec_height, - generate_map(map.x, map.z, map.w, map.h, x, y, map.detail, map.scale, height_mode, map_is_filled, map_get_marker, map), + generate_map(map.x, map.z, map.w, map.h, + x, y, map.detail, map.scale, height_mode, map_is_filled, map_get_marker, map), }, formspec_width, formspec_height; end