summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-26 01:26:25 -0700
committerIra Rice <irarice@gmail.com>2009-01-26 01:26:25 -0700
commit062f4065f5a2117fc5fd5f408e1f3163e2f63afc (patch)
tree83e9f5053dcf16049cc416f05b03e7bbf9c916fe /src/beingmanager.cpp
parentcd0bbf213902665f795d10a38c4f847f681c290c (diff)
downloadmana-client-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.gz
mana-client-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.bz2
mana-client-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.xz
mana-client-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.zip
Fixed offset of right-click hitboxes and made NPCs without sprites
clickable. Also set a minimum clickable area so that small mobs like maggots aren't too difficult to click. Been wanting this patched for a while, but didn't know where to look until Crush's patch for mainline click zones on TMW. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index b2dc330b..6b71b3bf 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -129,12 +129,16 @@ Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y)
for (; itr != itr_end; ++itr)
{
Being *being = (*itr);
+
+ int xtol = being->getWidth();
+ int uptol = being->getHeight();
+
if ((being->mAction != Being::DEAD) &&
(being != player_node) &&
(being->getPixelX() <= x) &&
- (being->getPixelX() + being->getWidth() >= x) &&
- (being->getPixelY() <= y) &&
- (being->getPixelY() + being->getHeight() >= y))
+ (being->getPixelX() + xtol >= x) &&
+ (being->getPixelY() - (uptol / 2) <= y) &&
+ (being->getPixelY() + (uptol / 2) >= y))
{
return being;
}