Prevent crash caused by nil in division returned by `minetest.get_node_light` in solar_helmet.lua

This commit is contained in:
mrkubax10 2024-01-18 18:20:23 +01:00
parent 752731972c
commit e95a2a7cc1
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ local function onGlobalStep(player,inv,stack)
if stack:get_name()~="industrialtest:solar_helmet" then
return false
end
local amount=math.floor(minetest.get_node_light(player:get_pos())/2)
local amount=math.floor((minetest.get_node_light(player:get_pos()) or 0)/2)
if amount==0 then
return true
end