summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-03-25 00:39:23 +0100
committerFedja Beader <fedja@protonmail.ch>2025-03-25 01:17:42 +0100
commit6b7dac777cf7e0bb5d8546bdb51dcd6f04deca0b (patch)
tree73677f05a8d1d7ec974155f2f0965f3b2cbc3845
parent7cad2fb4bbde1b82e1f31c01c0bebb205a35689f (diff)
downloadmanaplus-6b7dac777cf7e0bb5d8546bdb51dcd6f04deca0b.tar.gz
manaplus-6b7dac777cf7e0bb5d8546bdb51dcd6f04deca0b.tar.bz2
manaplus-6b7dac777cf7e0bb5d8546bdb51dcd6f04deca0b.tar.xz
manaplus-6b7dac777cf7e0bb5d8546bdb51dcd6f04deca0b.zip
findNearestLivingBeing: move (unknown) cheap check before set lookup
seems to skip beings with info if stopattack is active or if they are marked as unselectable (like hammocks in ML)... huh?
-rw-r--r--src/actormanager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/actormanager.cpp b/src/actormanager.cpp
index 737a864a7..2b542fede 100644
--- a/src/actormanager.cpp
+++ b/src/actormanager.cpp
@@ -1305,6 +1305,12 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
}
Being *const being = static_cast<Being*>(*i);
+ if ((being->getInfo() != nullptr)
+ && !(being->getInfo()->isTargetSelection() || modActive))
+ {
+ continue;
+ }
+
int priority = defaultPriorityIndex;
if (filtered)
{
@@ -1331,12 +1337,6 @@ Being *ActorManager::findNearestLivingBeing(const Being *const aroundBeing,
}
}
- if ((being->getInfo() != nullptr)
- && !(being->getInfo()->isTargetSelection() || modActive))
- {
- continue;
- }
-
if (!validateBeing(aroundBeing, being, type, excluded, 50))
continue;