From 0dbf81d178fe664ca7bc8738d8849be6101d3695 Mon Sep 17 00:00:00 2001 From: "Leilani A." <168607226+kaleohanopahala@users.noreply.github.com> Date: Sun, 29 Sep 2024 15:40:58 -0300 Subject: [PATCH] fix typo --- src/creatures/monsters/monster.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/creatures/monsters/monster.cpp b/src/creatures/monsters/monster.cpp index e79e49c8545..a8cd2be47d1 100644 --- a/src/creatures/monsters/monster.cpp +++ b/src/creatures/monsters/monster.cpp @@ -1341,14 +1341,15 @@ void Monster::doWalkBack(uint32_t &flags, Direction &nextDirection, bool &result updateMapCache(); } + // Return if the distance is less than or equal to 10 int32_t distance = std::max(Position::getDistanceX(position, masterPos), Position::getDistanceY(position, masterPos)); - if (distance == 0 || !spawnMonster) { + if (distance <= 10 || !spawnMonster) { isWalkingBack = false; return; } std::vector listDir; - if (getPathTo(masterPos, listDir, 0, std::max(0, distance - 5), true, true, distance)) { + if (getPathTo(masterPos, listDir, 0, distance - 10, true, true, distance)) { startAutoWalk(listDir); } else { isWalkingBack = false;