summaryrefslogtreecommitdiff
path: root/src/being.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/being.cpp
parentcd0bbf213902665f795d10a38c4f847f681c290c (diff)
downloadmana-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.gz
mana-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.bz2
mana-062f4065f5a2117fc5fd5f408e1f3163e2f63afc.tar.xz
mana-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/being.cpp')
-rw-r--r--src/being.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 3fc679da..ad5f4204 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -571,11 +571,14 @@ int Being::getWidth() const
{
if (mSprites[BASE_SPRITE])
{
- return mSprites[BASE_SPRITE]->getWidth();
+ const int width = mSprites[BASE_SPRITE]->getWidth() > Being::DEFAULT_WIDTH ?
+ mSprites[BASE_SPRITE]->getWidth() :
+ Being::DEFAULT_WIDTH;
+ return width;
}
else
{
- return 0;
+ return Being::DEFAULT_WIDTH;
}
}
@@ -584,11 +587,14 @@ int Being::getHeight() const
{
if (mSprites[BASE_SPRITE])
{
- return mSprites[BASE_SPRITE]->getHeight();
+ const int height = mSprites[BASE_SPRITE]->getHeight() > Being::DEFAULT_HEIGHT ?
+ mSprites[BASE_SPRITE]->getHeight() :
+ Being::DEFAULT_HEIGHT;
+ return height;
}
else
{
- return 0;
+ return Being::DEFAULT_HEIGHT;
}
}