replace minetest 5.0 check
This commit is contained in:
parent
c158e84e28
commit
11e1d52cfb
6
api.lua
6
api.lua
@ -8,7 +8,7 @@ local use_cmi = minetest.global_exists("cmi")
|
|||||||
|
|
||||||
mobs = {
|
mobs = {
|
||||||
mod = "redo",
|
mod = "redo",
|
||||||
version = "20210203",
|
version = "20210206",
|
||||||
intllib = S,
|
intllib = S,
|
||||||
invis = minetest.global_exists("invisibility") and invisibility or {}
|
invis = minetest.global_exists("invisibility") and invisibility or {}
|
||||||
}
|
}
|
||||||
@ -539,12 +539,10 @@ local ray_line_of_sight = function(self, pos1, pos2)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
-- detect if using minetest 5.0 by searching for permafrost node
|
|
||||||
local is_50 = minetest.registered_nodes["default:permafrost"]
|
|
||||||
|
|
||||||
function mob_class:line_of_sight(pos1, pos2, stepsize)
|
function mob_class:line_of_sight(pos1, pos2, stepsize)
|
||||||
|
|
||||||
if is_50 then -- only use if minetest 5.0 is detected
|
if minetest.raycast then -- only use if minetest 5.0 is detected
|
||||||
return ray_line_of_sight(self, pos1, pos2)
|
return ray_line_of_sight(self, pos1, pos2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user