*Fix a crash by unit with 0 maxhealth.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-27 18:40:09 -05:00
parent 05d4b02eee
commit bd5a53a774
+2
View File
@@ -11912,6 +11912,8 @@ void Unit::SetHealth(uint32 val)
void Unit::SetMaxHealth(uint32 val) void Unit::SetMaxHealth(uint32 val)
{ {
if(!val) val = 1;
uint32 health = GetHealth(); uint32 health = GetHealth();
SetUInt32Value(UNIT_FIELD_MAXHEALTH, val); SetUInt32Value(UNIT_FIELD_MAXHEALTH, val);