* Fix crash when minetest.get_node_light() returns nil
This commit is contained in:
parent
f3ac2bde3e
commit
dbf260c48d
3
init.lua
3
init.lua
|
@ -41,7 +41,8 @@ local get_node_color = function( node )
|
|||
end
|
||||
|
||||
local get_light = function( position )
|
||||
return minetest.get_node_light( position ) / 16
|
||||
local node_light = minetest.get_node_light( position )
|
||||
return node_light and node_light / 16 or 0
|
||||
end
|
||||
|
||||
local get_fog = function( distance )
|
||||
|
|
Loading…
Reference in New Issue