diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-26 20:04:36 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-26 20:04:49 +0200 |
commit | 2f68a9da7121ab2adaa70ff257577ee596b4c4ee (patch) | |
tree | d858a2eb16f2a89a856015a15396b87b835d12cd /src/game-server/being.cpp | |
parent | 53b547b11fb3c34bd6e2ae0bae0090f2677ef529 (diff) | |
download | manaserv-2f68a9da7121ab2adaa70ff257577ee596b4c4ee.tar.gz manaserv-2f68a9da7121ab2adaa70ff257577ee596b4c4ee.tar.bz2 manaserv-2f68a9da7121ab2adaa70ff257577ee596b4c4ee.tar.xz manaserv-2f68a9da7121ab2adaa70ff257577ee596b4c4ee.zip |
Some general cleanups and merged Being::perform() into update()
The main change here is to remove the separate calling of 'perform' on all
beings, and rather rely on the beings to do whatever they were doing in
that function when the virtual 'update' function is called.
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r-- | src/game-server/being.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp index 3fc0bab1..1669e55d 100644 --- a/src/game-server/being.cpp +++ b/src/game-server/being.cpp @@ -180,7 +180,8 @@ void Being::died() { const EventListener &l = **i; ++i; // In case the listener removes itself from the list on the fly. - if (l.dispatch->died) l.dispatch->died(&l, this); + if (l.dispatch->died) + l.dispatch->died(&l, this); } } @@ -432,7 +433,7 @@ int Being::performAttack(Being *target, const Damage &damage) // Note: The auto-attack system will handle the delay between two attacks. - return (mTarget->damage(this, damage)); + return target->damage(this, damage); } void Being::setAction(BeingAction action) @@ -640,7 +641,8 @@ void Being::update() //update timers for (Timers::iterator i = mTimers.begin(); i != mTimers.end(); i++) { - if (i->second > -1) i->second--; + if (i->second > -1) + i->second--; } int oldHP = getModifiedAttribute(ATTR_HP); |