Fix error when 'default' is disabled (#28)

This commit is contained in:
Niklp 2023-11-25 18:46:48 +01:00 committed by GitHub
parent 1487fb246e
commit 3dfc262359
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -1 +0,0 @@
default?

View File

@ -631,14 +631,16 @@ wielded_light.register_player_lightstep(function (player)
end) end)
-- Register helper nodes -- 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("air", nil, "")
wielded_light.register_lightable_node(water_name, nil, "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_") 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 ---TEST
--wielded_light.register_item_light('default:dirt', 14) --wielded_light.register_item_light('default:dirt', 14)