mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-26 04:21:07 +01:00
Add anon5's fix to prevent get_light crashes
This commit is contained in:
parent
7e3dd715af
commit
ae1212be7f
1 changed files with 3 additions and 3 deletions
|
@ -1515,9 +1515,9 @@ local is_at_water_danger = function(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_light(pos, tod)
|
local function get_light(pos, tod)
|
||||||
if minetest.get_node_or_nil(pos) then
|
local ok, light = pcall(minetest.get_natural_light or minetest.get_node_light, pos, tod)
|
||||||
local lightfunc = minetest.get_natural_light or minetest.get_node_light
|
if ok then
|
||||||
return lightfunc(pos, tod)
|
return light
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue