ThePython10110 / ExchangeClone

Equivalent Exchange/ProjectE for Minetest Game and MineClone2/Mineclonia
https://github.com/ThePython10110/ExchangeClone/wiki
GNU General Public License v3.0
3 stars 2 forks source link

Fix error where energy_collector.lua tries to compare to nil #9

Closed programmerjake closed 11 months ago

programmerjake commented 11 months ago

Fixes the following error:

2023-11-20 23:40:18: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'exchangeclone' in callback node_on_timer(): ...netest/.minetest/mods/exchangeclone/energy_collector.lua:98: attempt to compare number with nil
2023-11-20 23:40:18: ERROR[Main]: stack traceback:
2023-11-20 23:40:18: ERROR[Main]:   ...netest/.minetest/mods/exchangeclone/energy_collector.lua:98: in function <...netest/.minetest/mods/exchangeclone/energy_collector.lua:85>
ThePython10110 commented 11 months ago

I had no idea get_natural_light could return nil. That line's been in there since the beginning, and I haven't experienced any issues with it... but I checked the API and it can return nil (although it never explains why).