From 5567195a138a807577bc5d78fc06d6d0a1b60163 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sun, 8 Sep 2024 12:47:35 -0400 Subject: [PATCH] v2.5.0: adjusted mob inefficient path tolerance changes --- .../shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index 6c3cee275..6a590e409 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -504,11 +504,13 @@ public abstract class Mob extends Char { } else { boolean newPath = false; + float longFactor = state == WANDERING ? 2f : 1.33f; //scrap the current path if it's empty, no longer connects to the current location //or if it's quite inefficient and checking again may result in a much better path + //mobs are much more tolerant of inefficient paths if wandering if (path == null || path.isEmpty() || !Dungeon.level.adjacent(pos, path.getFirst()) - || path.size() > 1.33f*Dungeon.level.distance(pos, target)) + || path.size() > longFactor*Dungeon.level.distance(pos, target)) newPath = true; else if (path.getLast() != target) { //if the new target is adjacent to the end of the path, adjust for that