diff --git a/mods/ENTITIES/mcl_mobs/pathfinding.lua b/mods/ENTITIES/mcl_mobs/pathfinding.lua index b94268c5a..1374237f0 100644 --- a/mods/ENTITIES/mcl_mobs/pathfinding.lua +++ b/mods/ENTITIES/mcl_mobs/pathfinding.lua @@ -306,7 +306,7 @@ function mob_class:gopath(target, callback_arrived, prioritised) wp[i+1].action = {type = "door", action = "close", target = wp[i].pos} end -- do not jump on fences and walls, but try to walk around - elseif bdef and ((bdef.groups.fence or 0) > 0 or (bdef.groups.wall or 0) > 0) and wp[i].pos.y > wp[i-1].pos.y then + elseif bdef and i > 1 and ((bdef.groups.fence or 0) > 0 or (bdef.groups.wall or 0) > 0) and wp[i].pos.y > wp[i-1].pos.y then -- find end of wall(s) local j = i + 1 while j <= #wp do