mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-16 15:30:30 +01:00
parent
31c40de110
commit
6ddba5a15e
|
@ -212,11 +212,13 @@ function mobs:register_mob(name, def)
|
||||||
and self.child == false
|
and self.child == false
|
||||||
and math.random(1,self.replace_rate) == 1 then
|
and math.random(1,self.replace_rate) == 1 then
|
||||||
local pos = self.object:getpos()
|
local pos = self.object:getpos()
|
||||||
|
local nodeunder = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
||||||
pos.y = pos.y + self.replace_offset
|
pos.y = pos.y + self.replace_offset
|
||||||
-- print ("replace node = ".. minetest.get_node(pos).name, pos.y)
|
-- print ("replace node = ".. minetest.get_node(pos).name, pos.y)
|
||||||
if self.replace_what
|
if self.replace_what
|
||||||
and self.object:getvelocity().y == 0
|
and self.object:getvelocity().y == 0
|
||||||
and #minetest.find_nodes_in_area(pos, pos, self.replace_what) > 0 then
|
and #minetest.find_nodes_in_area(pos, pos, self.replace_what) > 0 --then
|
||||||
|
and nodeunder and nodeunder.name ~= "air" then
|
||||||
--and self.state == "stand" then
|
--and self.state == "stand" then
|
||||||
minetest.set_node(pos, {name = self.replace_with})
|
minetest.set_node(pos, {name = self.replace_with})
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user