summaryrefslogtreecommitdiff
path: root/src/actormanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/actormanager.cpp')
-rw-r--r--src/actormanager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index f8d4e137e..265c60e17 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1038,7 +1038,8 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
const bool valid = validateBeing(aroundBeing, being,
type, excluded, 50);
int d = being->getDistance();
- if (being->getType() != ActorType::MONSTER || !mTargetOnlyReachable)
+ if (being->getType() != ActorType::MONSTER
+ || !mTargetOnlyReachable)
{ // if distance not calculated, use old distance
d = (being->getTileX() - x) * (being->getTileX() - x)
+ (being->getTileY() - y) * (being->getTileY() - y);