diff options
author | Philipp Sehmisch <tmw@crushnet.org> | 2008-01-23 17:12:13 +0000 |
---|---|---|
committer | Philipp Sehmisch <tmw@crushnet.org> | 2008-01-23 17:12:13 +0000 |
commit | 553c82854a643a3c158f1e467d21411d444f4801 (patch) | |
tree | e97c3bb760fe4cafc8530a57290715a0fd6fcdf6 | |
parent | 36fc47a7dd3f21a7d7608ca3ab476cf2d84d33e0 (diff) | |
download | manaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.gz manaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.bz2 manaserv-553c82854a643a3c158f1e467d21411d444f4801.tar.xz manaserv-553c82854a643a3c158f1e467d21411d444f4801.zip |
Fixed "immortal monster" bug.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/game-server/being.cpp | 12 |
2 files changed, 8 insertions, 8 deletions
@@ -1,3 +1,7 @@ +2008-01-23 Philipp Sehmisch <tmw@crushnet.org> + + * src/game-server/being.cpp: Fixed "immortal monster" bug. + 2008-01-10 Philipp Sehmisch <tmw@crushnet.org> * src/game-server/inventory.cpp, src/game-server/item.hpp, 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; } |