diff options
author | megamage <none@none> | 2008-12-08 17:53:18 -0600 |
---|---|---|
committer | megamage <none@none> | 2008-12-08 17:53:18 -0600 |
commit | 26259a5fa4b304f2ee68f369cf5388f7336f4c93 (patch) | |
tree | 4dfe242d00a2e311419036157568e64c5596ad43 /src | |
parent | deaa21826a9c248f3af8cf0f98a46a87ac849f3f (diff) |
*Try to fix the bug that players "do not die" when killed.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index c6a1f17df35..91ad509abc2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -10740,9 +10740,14 @@ void Unit::SetLevel(uint32 lvl) void Unit::SetHealth(uint32 val) { - uint32 maxHealth = GetMaxHealth(); - if(maxHealth < val) - val = maxHealth; + if(!isAlive()) + val = 0; + else + { + uint32 maxHealth = GetMaxHealth(); + if(maxHealth < val) + val = maxHealth; + } SetUInt32Value(UNIT_FIELD_HEALTH, val); |