summaryrefslogtreecommitdiff
path: root/src/beingmanager.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-01-27 01:46:58 +0100
committerBertram <bertram@cegetel.net>2010-01-27 01:46:58 +0100
commit572ed6a1aa6c847e8764bddf2bb0d687ecf1a405 (patch)
treef0183d944a3a887b359e2dc2895e87a9c2767e66 /src/beingmanager.cpp
parent692aac3122843c59610684802e25b92cc9f0a33c (diff)
downloadmana-572ed6a1aa6c847e8764bddf2bb0d687ecf1a405.tar.gz
mana-572ed6a1aa6c847e8764bddf2bb0d687ecf1a405.tar.bz2
mana-572ed6a1aa6c847e8764bddf2bb0d687ecf1a405.tar.xz
mana-572ed6a1aa6c847e8764bddf2bb0d687ecf1a405.zip
Added mutators/accessors to being.h and smal cleanups.
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r--src/beingmanager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp
index 1f1230d4..7c2ddc44 100644
--- a/src/beingmanager.cpp
+++ b/src/beingmanager.cpp
@@ -43,7 +43,7 @@ class FindBeingFunctor
const Vector &pos = being->getPosition();
return ((int) pos.x / 32 == x &&
((int) pos.y / 32 == y || (int) pos.y / 32 == other_y) &&
- being->mAction != Being::DEAD &&
+ being->isAlive() &&
(type == Being::UNKNOWN || being->getType() == type));
}
@@ -141,7 +141,7 @@ Being *BeingManager::findBeingByPixel(int x, int y) const
int xtol = being->getWidth() / 2;
int uptol = being->getHeight();
- if ((being->mAction != Being::DEAD) &&
+ if ((being->isAlive()) &&
(being != player_node) &&
(being->getPixelX() - xtol <= x) &&
(being->getPixelX() + xtol >= x) &&
@@ -183,8 +183,9 @@ void BeingManager::logic()
being->logic();
- if (being->mAction == Being::DEAD &&
- Net::getGameHandler()->removeDeadBeings() && being->mFrame >= 20)
+ if (!being->isAlive() &&
+ Net::getGameHandler()->removeDeadBeings() &&
+ being->getCurrentFrame() >= 20)
{
delete being;
i = mBeings.erase(i);
@@ -228,7 +229,7 @@ Being *BeingManager::findNearestLivingBeing(int x, int y,
if ((being->getType() == type || type == Being::UNKNOWN)
&& (d < dist || !closestBeing) // it is closer
- && being->mAction != Being::DEAD) // no dead beings
+ && being->isAlive()) // no dead beings
{
dist = d;
closestBeing = being;