summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2025-03-25 00:39:23 +0100
committerFedja Beader <fedja@protonmail.ch>2025-04-06 01:44:21 +0200
commitac95cf4561b07279296e2c49c951ac55f163edbd (patch)
tree4fdd45e476b9b1a86fb30c7fdb4fab9789f1c548
parent252f6f159bd96279a5111b328e5dca349e1832a1 (diff)
downloadplus-ac95cf4561b07279296e2c49c951ac55f163edbd.tar.gz
plus-ac95cf4561b07279296e2c49c951ac55f163edbd.tar.bz2
plus-ac95cf4561b07279296e2c49c951ac55f163edbd.tar.xz
plus-ac95cf4561b07279296e2c49c951ac55f163edbd.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? **** mana/plus!145
-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;