diff --git a/settingtypes.txt b/settingtypes.txt index 8c606b6..f695458 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -46,4 +46,4 @@ magma_conduits_volcano_probability_extinct (Probability of extinct volcano in re magma_conduits_show_volcanoes_in_hud (Show volcanoes in HUD) bool true magma_conduits_hud_requires_mapping_kit (Require mapping kit to show in HUD) bool true magma_conduits_volcano_discovery_range (Volcano discovery range) int 60 -magma_conduits_volcano_visibility_range (Volcano HUD visibility range) int 1200 \ No newline at end of file +magma_conduits_volcano_visibility_range (Volcano HUD visibility range) int 1000 \ No newline at end of file diff --git a/volcanoes.lua b/volcanoes.lua index 786712c..63f38e7 100644 --- a/volcanoes.lua +++ b/volcanoes.lua @@ -9,16 +9,21 @@ dofile(modpath .. "/volcano_lava.lua") -- https://github.com/minetest/minetest/i local S, NS = dofile(modpath.."/intllib.lua") ---dofile(modpath .. "/hud.lua") + +local requires_mapping_kit +if minetest.settings:get_bool("magma_conduits_hud_requires_mapping_kit", true) + and minetest.registered_items["map:mapping_kit"] then + requires_mapping_kit = "map:mapping_kit" +end local named_waypoints_modpath = minetest.get_modpath("named_waypoints") if named_waypoints_modpath then named_waypoints.register_named_waypoints("volcanoes", { default_name = S("a volcano"), default_color = 0xFFFFFF, - visibility_requires_item = "map:mapping_kit", - visibility_volume_radius = 1200, - discovery_volume_radius = 60, + visibility_requires_item = requires_mapping_kit, + visibility_volume_radius = tonumber(minetest.settings:get("magma_conduits_volcano_visibility_range")) or 1000, + discovery_volume_radius = tonumber(minetest.settings:get("magma_conduits_volcano_discovery_range")) or 60, on_discovery = named_waypoints.default_discovery_popup }) end