aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-12 13:50:47 -0700
committermaximius <none@none>2009-10-12 13:50:47 -0700
commit8d59bf8179fcc936e9296910c680429a70347c77 (patch)
tree4392fa10a0b168bd1d2d9f455a86c97667544a16 /src/game/Unit.cpp
parentcb09262c1a1e428c6504b5e7a7b98209aa1a5d16 (diff)
*Bitwise logic does not work on values that are not bitmasks. Thanks Spp for pointing this block of code out :)
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 90eab95401b..6bdb04cd90f 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11971,8 +11971,7 @@ void Unit::SetHealth(uint32 val)
{
if(getDeathState() == JUST_DIED)
val = 0;
- // causes instant permadeath if you exit game while in combat?! :-|
- else if((GetTypeId() == TYPEID_PLAYER) && (getDeathState() & (DEAD | DEAD_FALLING)) != 0)
+ else if(GetTypeId() == TYPEID_PLAYER && (getDeathState() == DEAD || getDeathState() == DEAD_FALLING))
val = 1;
else
{