diff --git a/mods/mobs/api.lua b/mods/mobs/api.lua index 75a6fea9..de0bc049 100755 --- a/mods/mobs/api.lua +++ b/mods/mobs/api.lua @@ -212,11 +212,13 @@ function mobs:register_mob(name, def) and self.child == false and math.random(1,self.replace_rate) == 1 then 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 -- print ("replace node = ".. minetest.get_node(pos).name, pos.y) if self.replace_what 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 minetest.set_node(pos, {name = self.replace_with}) end