From 9ea8945ff433bd90bfc69a0965de497853198c89 Mon Sep 17 00:00:00 2001 From: kno10 Date: Mon, 28 Oct 2024 23:59:28 +0100 Subject: [PATCH] Fixup fences --- mods/ENTITIES/mcl_mobs/pathfinding.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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