summaryrefslogtreecommitdiff
path: root/src/game-server/being.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-03-02 18:54:11 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-03-02 18:54:11 +0000
commit3cf2198e2485c80633f8d80d1a4c12843db86fde (patch)
treeecf35ba18c928275089e3614e48dc7dc7360ea79 /src/game-server/being.cpp
parent2fd66a97ffceb05ab0020545b81f5e5a8de06c13 (diff)
downloadmanaserv-3cf2198e2485c80633f8d80d1a4c12843db86fde.tar.gz
manaserv-3cf2198e2485c80633f8d80d1a4c12843db86fde.tar.bz2
manaserv-3cf2198e2485c80633f8d80d1a4c12843db86fde.tar.xz
manaserv-3cf2198e2485c80633f8d80d1a4c12843db86fde.zip
Moved death check from Being::damage to Being::update for more reliable death detection and to fix the bug that the last hit on a monster does not count for exp calculation.
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r--src/game-server/being.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index e0b16ed7..6cbf4c31 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -88,7 +88,6 @@ int Being::damage(Object *, Damage const &damage)
LOG_DEBUG("Being " << getPublicID() << " suffered "<<HPloss<<" damage. HP: "<<HP.base + HP.mod<<"/"<<HP.base);
HP.mod -= HPloss;
modifiedAttribute(BASE_ATTR_HP);
- if (HP.base + HP.mod <= 0) died();
return HPloss;
}
@@ -237,4 +236,10 @@ void Being::update()
}
++i;
}
+
+ //check if being died
+ if (getModifiedAttribute(BASE_ATTR_HP) <= 0 && mAction != DEAD)
+ {
+ died();
+ }
}