diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-26 01:56:55 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-26 01:56:55 -0700 |
commit | 803e0dae01f09afbe529799cf89a8f57fe518ddb (patch) | |
tree | 6721b01603dcf77934cdb55afa659580a215b56d /src/beingmanager.cpp | |
parent | 062f4065f5a2117fc5fd5f408e1f3163e2f63afc (diff) | |
download | mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.gz mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.bz2 mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.tar.xz mana-client-803e0dae01f09afbe529799cf89a8f57fe518ddb.zip |
Bit of code cleanup for the last commit (moved default width and height
out of being.h, so that they aren't included in any classes that don't
need them and cut the number of divisions in half in the being manager)
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r-- | src/beingmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |