From e95a2a7cc1db1393ce5a2668487d55822aaeb9bf Mon Sep 17 00:00:00 2001 From: mrkubax10 Date: Thu, 18 Jan 2024 18:20:23 +0100 Subject: [PATCH] Prevent crash caused by nil in division returned by `minetest.get_node_light` in solar_helmet.lua --- tools/solar_helmet.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/solar_helmet.lua b/tools/solar_helmet.lua index 6493507..d6bdc92 100644 --- a/tools/solar_helmet.lua +++ b/tools/solar_helmet.lua @@ -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