Fix error where energy_collector.lua tries to compare to nil

This commit is contained in:
Jacob Lifshay 2023-11-20 23:54:58 -08:00 committed by GitHub
parent 7fb4724961
commit 399bb14528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -95,7 +95,9 @@ local function on_timer(pos, elapsed)
using_orb = false
end
if minetest.get_natural_light(above) >= 14 then
local light = minetest.get_natural_light(above)
if light and light >= 14 then
if check_for_furnaces(pos, 1, true) then
-- do nothing, energy is being used for the furnace.
return true
@ -306,4 +308,4 @@ exchangeclone.register_energy_collector("exchangeclone:energy_collector_mk5", "E
{"exchangeclone:energy_collector_mk4", "exchangeclone:energy_collector_mk4", "exchangeclone:energy_collector_mk4"},
{iron, iron, iron}
}
)
)