Validate tunnel_lights setting, and use default:torch if invalid.
parent
d85358b381
commit
5632b309c3
25
init.lua
25
init.lua
|
@ -6,6 +6,10 @@
|
||||||
-- by David G (kestral246@gmail.com)
|
-- by David G (kestral246@gmail.com)
|
||||||
-- and by Mikola
|
-- and by Mikola
|
||||||
|
|
||||||
|
-- Version 2.2.0 - 2022-08-15
|
||||||
|
-- Pull request from rlars: Allow access to dig_tunnel for other mods.
|
||||||
|
-- Validate tunnel_lights setting, and if invalid use default:torch instead.
|
||||||
|
|
||||||
-- Version 2.1.0 - 2021-07-02
|
-- Version 2.1.0 - 2021-07-02
|
||||||
-- Perform protection checks on all nodes before digging tunnel.
|
-- Perform protection checks on all nodes before digging tunnel.
|
||||||
-- Perform protection checks during clear tree cover.
|
-- Perform protection checks during clear tree cover.
|
||||||
|
@ -134,15 +138,18 @@ local user_config = {}
|
||||||
|
|
||||||
-- Adjust light spacing and deal with multi-orientation lights.
|
-- Adjust light spacing and deal with multi-orientation lights.
|
||||||
minetest.register_on_mods_loaded(function()
|
minetest.register_on_mods_loaded(function()
|
||||||
if minetest.registered_nodes[lighting] then
|
if minetest.registered_nodes[lighting] == nil then
|
||||||
if minetest.registered_nodes[lighting].light_source > 13 then
|
minetest.log("warning", "Tunnelmaker: Setting for tunnel_lights ("..lighting..") invalid. Using default:torch instead.")
|
||||||
lighting_search_radius = 2
|
lighting = "default:torch"
|
||||||
end
|
lighting_p2 = 0
|
||||||
if minetest.registered_nodes[lighting].drop then
|
end
|
||||||
multi_orient = true
|
if minetest.registered_nodes[lighting].light_source > 13 then
|
||||||
base_lighting = minetest.registered_nodes[lighting].drop
|
lighting_search_radius = 2
|
||||||
-- minetest.debug("base = "..base_lighting) -- debug
|
end
|
||||||
end
|
if minetest.registered_nodes[lighting].drop then
|
||||||
|
multi_orient = true
|
||||||
|
base_lighting = minetest.registered_nodes[lighting].drop
|
||||||
|
-- minetest.debug("base = "..base_lighting) -- debug
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue