summaryrefslogtreecommitdiff
path: root/src/actorspritemanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-21 01:41:13 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-21 01:41:13 +0300
commit1f846d2863d36543c854fe630519a4d1fd01f802 (patch)
tree68271299e6d33417d36690f1be6b4544d3aaa224 /src/actorspritemanager.cpp
parent8138d0e61f633546263df94473e91d500ada9c0e (diff)
downloadmanaverse-1f846d2863d36543c854fe630519a4d1fd01f802.tar.gz
manaverse-1f846d2863d36543c854fe630519a4d1fd01f802.tar.bz2
manaverse-1f846d2863d36543c854fe630519a4d1fd01f802.tar.xz
manaverse-1f846d2863d36543c854fe630519a4d1fd01f802.zip
Improve mouse object selection if near mixed floor items and monsters.
Diffstat (limited to 'src/actorspritemanager.cpp')
-rw-r--r--src/actorspritemanager.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp
index 03418a857..52d807f64 100644
--- a/src/actorspritemanager.cpp
+++ b/src/actorspritemanager.cpp
@@ -308,9 +308,22 @@ Being *ActorSpriteManager::findBeingByPixel(int x, int y,
if (!*it)
continue;
- if ((*it)->getType() == ActorSprite::FLOOR_ITEM
- || (*it)->getType() == ActorSprite::PORTAL)
+ if ((*it)->getType() == ActorSprite::PORTAL)
+ continue;
+
+ if ((*it)->getType() == ActorSprite::FLOOR_ITEM)
{
+ if (!noBeing)
+ {
+ FloorItem *floor = static_cast<FloorItem*>(*it);
+ if (!noBeing && (floor->getPixelX() - 32 <= x) &&
+ (floor->getPixelX() + 32 > x) &&
+ (floor->getPixelY() - 64 <= y) &&
+ (floor->getPixelY() + 16 > y))
+ {
+ noBeing = true;
+ }
+ }
continue;
}