Merge pull request #9 from programmerjake/fix-energy-collector

Fix error where energy_collector.lua tries to compare to nil
This commit is contained in:
ThePython 2023-11-21 13:22:04 -08:00 committed by GitHub
commit 2b5fad975a
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}
}
)
)