Fixup fences

This commit is contained in:
kno10 2024-10-28 23:59:28 +01:00
parent 488f61ba1b
commit 9ea8945ff4
1 changed files with 1 additions and 1 deletions

View File

@ -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