mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-19 09:31:07 +01:00
Use get_node_light for sunlight in 5.3
Avoids servers running 5.3 crashing.
This commit is contained in:
parent
0805431231
commit
7441f0269b
1 changed files with 4 additions and 1 deletions
|
@ -1047,7 +1047,10 @@ local do_env_damage = function(self)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local sunlight = minetest.get_natural_light(pos, self.time_of_day)
|
-- Use get_node_light for Minetest version 5.3 where get_natural_light
|
||||||
|
-- does not exist yet.
|
||||||
|
local get_light = minetest.get_natural_light or minetest.get_node_light
|
||||||
|
local sunlight = get_light(pos, self.time_of_day)
|
||||||
|
|
||||||
-- bright light harms mob
|
-- bright light harms mob
|
||||||
if self.light_damage ~= 0 and (sunlight or 0) > 12 then
|
if self.light_damage ~= 0 and (sunlight or 0) > 12 then
|
||||||
|
|
Loading…
Reference in a new issue