summaryrefslogtreecommitdiff
path: root/src/game-server/being.cpp
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2008-01-23 17:12:13 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2008-01-23 17:12:13 +0000
commit553c82854a643a3c158f1e467d21411d444f4801 (patch)
treee97c3bb760fe4cafc8530a57290715a0fd6fcdf6 /src/game-server/being.cpp
parent36fc47a7dd3f21a7d7608ca3ab476cf2d84d33e0 (diff)
downloadmanaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.gz
manaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.bz2
manaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.xz
manaserv-553c82854a643a3c158f1e467d21411d444f4801.zip
Fixed "immortal monster" bug.
Diffstat (limited to 'src/game-server/being.cpp')
-rw-r--r--src/game-server/being.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/game-server/being.cpp b/src/game-server/being.cpp
index ce7f06db..e0b16ed7 100644
--- a/src/game-server/being.cpp
+++ b/src/game-server/being.cpp
@@ -83,16 +83,12 @@ int Being::damage(Object *, Damage const &damage)
if (HPloss < 0) HPloss = 0;
mHitsTaken.push_back(HPloss);
- LOG_DEBUG("Being " << getPublicID() << " got hit.");
Attribute &HP = mAttributes[BASE_ATTR_HP];
- if (HPloss >= HP.base + HP.mod) HPloss = HP.base + HP.mod;
- if (HPloss > 0)
- {
- HP.mod -= HPloss;
- modifiedAttribute(BASE_ATTR_HP);
- if (HP.base + HP.mod == 0) died();
- }
+ 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;
}