forked from mrkubax10/industrialtest
Prevent crash caused by nil in division returned by minetest.get_node_light
in solar_helmet.lua
This commit is contained in:
parent
752731972c
commit
e95a2a7cc1
@ -22,7 +22,7 @@ local function onGlobalStep(player,inv,stack)
|
|||||||
if stack:get_name()~="industrialtest:solar_helmet" then
|
if stack:get_name()~="industrialtest:solar_helmet" then
|
||||||
return false
|
return false
|
||||||
end
|
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
|
if amount==0 then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user