aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-27 18:40:09 -0500
committermegamage <none@none>2009-06-27 18:40:09 -0500
commitbd5a53a774104e97eb653a51ee8b2cadc21efa82 (patch)
tree8c981b1aa534d82011815d28b30c7be65ffc4db5 /src/game/Unit.cpp
parent05d4b02eee3420232f9c6b20b1d05373123934b7 (diff)
*Fix a crash by unit with 0 maxhealth.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9fc8a8496e5..fa748673eac 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -11912,6 +11912,8 @@ void Unit::SetHealth(uint32 val)
void Unit::SetMaxHealth(uint32 val)
{
+ if(!val) val = 1;
+
uint32 health = GetHealth();
SetUInt32Value(UNIT_FIELD_MAXHEALTH, val);