From 3dfc2623598e095954b0a97f6bac6da7096cdf10 Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Sat, 25 Nov 2023 18:46:48 +0100 Subject: [PATCH] Fix error when 'default' is disabled (#28) --- depends.txt | 1 - init.lua | 16 +++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) delete mode 100644 depends.txt diff --git a/depends.txt b/depends.txt deleted file mode 100644 index 5e78c21..0000000 --- a/depends.txt +++ /dev/null @@ -1 +0,0 @@ -default? diff --git a/init.lua b/init.lua index 48275e6..f36789f 100644 --- a/init.lua +++ b/init.lua @@ -631,14 +631,16 @@ wielded_light.register_player_lightstep(function (player) end) -- Register helper nodes -local water_name = "default:water_source" -if minetest.get_modpath("hades_core") then - water_name = "hades_core:water_source" -end - wielded_light.register_lightable_node("air", nil, "") -wielded_light.register_lightable_node(water_name, nil, "water_") -wielded_light.register_lightable_node("default:river_water_source", nil, "river_water_") + +if minetest.get_modpath("default") then + wielded_light.register_lightable_node("default:water_source", nil, "water_") + wielded_light.register_lightable_node("default:river_water_source", nil, "river_water_") +elseif minetest.get_modpath("hades_core") then + wielded_light.register_lightable_node("hades_core:water_source", nil, "water_") +else + error_log("Not running in a supported game, lightable water disabled") +end ---TEST --wielded_light.register_item_light('default:dirt', 14)