1 |
From 274d96292571495a45d32364c36531e7ff35aff0 Mon Sep 17 00:00:00 2001 |
2 |
From: Andrei Karas <akaras@inbox.ru> |
3 |
Date: Thu, 5 May 2011 01:27:21 +0300 |
4 |
Subject: [PATCH] Fix monsters selection if monster added to priority list |
5 |
and option "cycle monster target" disabled. |
6 |
|
7 |
--- |
8 |
src/actorspritemanager.cpp | 7 +++++-- |
9 |
1 files changed, 5 insertions(+), 2 deletions(-) |
10 |
|
11 |
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp |
12 |
index 6162ba7..3f37ce9 100644 |
13 |
--- a/src/actorspritemanager.cpp |
14 |
+++ b/src/actorspritemanager.cpp |
15 |
@@ -766,6 +766,7 @@ Being *ActorSpriteManager::findNearestLivingBeing(Being *aroundBeing, |
16 |
else |
17 |
{ |
18 |
int dist = 0; |
19 |
+ int index = defaultPriorityIndex; |
20 |
|
21 |
for (ActorSprites::const_iterator i = mActors.begin(), |
22 |
i_end = mActors.end(); |
23 |
@@ -797,7 +798,6 @@ Being *ActorSpriteManager::findNearestLivingBeing(Being *aroundBeing, |
24 |
|
25 |
bool valid = validateBeing(aroundBeing, being, type, excluded, 50); |
26 |
int d = being->getDistance(); |
27 |
- int index = defaultPriorityIndex; |
28 |
// logger->log("dist: %d", dist); |
29 |
// logger->log("name: %s, %d, %d", being->getName().c_str(), (int)valid, d); |
30 |
if (being->getType() != Being::MONSTER |
31 |
@@ -807,9 +807,12 @@ Being *ActorSpriteManager::findNearestLivingBeing(Being *aroundBeing, |
32 |
+ (being->getTileY() - y) * (being->getTileY() - y); |
33 |
} |
34 |
|
35 |
+ if (!valid) |
36 |
+ continue; |
37 |
+ |
38 |
// logger->log("being name:" + being->getName()); |
39 |
+// logger->log("index:" + toString(index)); |
40 |
// logger->log("d:" + toString(d)); |
41 |
-// logger->log("valid:" + toString(valid)) |
42 |
|
43 |
if (valid && !filtered && (d <= dist || closestBeing == 0)) |
44 |
{ |
45 |
-- |
46 |
1.7.1 |
47 |
|