Revert "mcl_mobs: when moving away from dangers, check if destination is dangerous itself"

This reverts commit baaf3e7a13.
This commit is contained in:
Alexander Minges 2020-05-03 17:53:39 +02:00
parent effa27bec1
commit a4ee8dfdd5

View file

@ -2026,7 +2026,7 @@ local do_states = function(self, dtime)
elseif self.fire_damage > 0 then
lp = minetest.find_node_near(s, 1, {"group:fire", "mcl_nether:magma"})
lp = minetest.find_node_near(s, 1, {"group:fire"})
end
@ -2041,26 +2041,6 @@ local do_states = function(self, dtime)
-- did we find land?
if lp then
local nn = minetest.get_node(lp).name
if is_node_dangerous(self, nn) then
-- is the chosen destination safe? Retry if not (max 10 iterations)
local i = 0
while i < 10 do
if lp then
nn = minetest.get_node(lp).name
minetest.log("Found solid block: " .. nn)
if not is_node_dangerous(self, nn) then break
end
-- look for solid node 5 blocks around the mob's position
elseif i < 5 then
lp = minetest.find_node_near(s, 5, {"group:solid"})
-- after 5 iterations double search radius
elseif i < 10 then
lp = minetest.find_node_near(s, 10, {"group:solid"})
end
i = i + 1
end
end
local vec = {
x = lp.x - s.x,