summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/being.cpp15
-rw-r--r--src/being.h3
-rw-r--r--src/beingmanager.cpp6
3 files changed, 12 insertions, 12 deletions
diff --git a/src/being.cpp b/src/being.cpp
index ad5f4204..985be69c 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -56,6 +56,9 @@ std::vector<AnimatedSprite*> Being::emotionSet;
static const int X_SPEECH_OFFSET = 18;
static const int Y_SPEECH_OFFSET = 60;
+static const int DEFAULT_WIDTH = 32;
+static const int DEFAULT_HEIGHT = 32;
+
Being::Being(int id, int job, Map *map):
mJob(job),
mX(0), mY(0),
@@ -571,14 +574,14 @@ int Being::getWidth() const
{
if (mSprites[BASE_SPRITE])
{
- const int width = mSprites[BASE_SPRITE]->getWidth() > Being::DEFAULT_WIDTH ?
+ const int width = mSprites[BASE_SPRITE]->getWidth() > DEFAULT_WIDTH ?
mSprites[BASE_SPRITE]->getWidth() :
- Being::DEFAULT_WIDTH;
+ DEFAULT_WIDTH;
return width;
}
else
{
- return Being::DEFAULT_WIDTH;
+ return DEFAULT_WIDTH;
}
}
@@ -587,14 +590,14 @@ int Being::getHeight() const
{
if (mSprites[BASE_SPRITE])
{
- const int height = mSprites[BASE_SPRITE]->getHeight() > Being::DEFAULT_HEIGHT ?
+ const int height = mSprites[BASE_SPRITE]->getHeight() > DEFAULT_HEIGHT ?
mSprites[BASE_SPRITE]->getHeight() :
- Being::DEFAULT_HEIGHT;
+ DEFAULT_HEIGHT;
return height;
}
else
{
- return Being::DEFAULT_HEIGHT;
+ return DEFAULT_HEIGHT;
}
}
diff --git a/src/being.h b/src/being.h
index a43297ad..80295db8 100644
--- a/src/being.h
+++ b/src/being.h
@@ -432,9 +432,6 @@ class Being : public Sprite
*/
int getOffset(char pos, char neg) const;
- static const int DEFAULT_WIDTH = 32;
- static const int DEFAULT_HEIGHT = 32;
-
// Speech Bubble components
SpeechBubble *mSpeechBubble;
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 6b71b3bf..9e620ca0 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -131,14 +131,14 @@ Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y)
Being *being = (*itr);
int xtol = being->getWidth();
- int uptol = being->getHeight();
+ int uptol = being->getHeight() / 2;
if ((being->mAction != Being::DEAD) &&
(being != player_node) &&
(being->getPixelX() <= x) &&
(being->getPixelX() + xtol >= x) &&
- (being->getPixelY() - (uptol / 2) <= y) &&
- (being->getPixelY() + (uptol / 2) >= y))
+ (being->getPixelY() - uptol <= y) &&
+ (being->getPixelY() + uptol >= y))
{
return being;
}