*Try to fix the bug that players "do not die" when killed.
--HG-- branch : trunk
This commit is contained in:
+8
-3
@@ -10740,9 +10740,14 @@ void Unit::SetLevel(uint32 lvl)
|
|||||||
|
|
||||||
void Unit::SetHealth(uint32 val)
|
void Unit::SetHealth(uint32 val)
|
||||||
{
|
{
|
||||||
uint32 maxHealth = GetMaxHealth();
|
if(!isAlive())
|
||||||
if(maxHealth < val)
|
val = 0;
|
||||||
val = maxHealth;
|
else
|
||||||
|
{
|
||||||
|
uint32 maxHealth = GetMaxHealth();
|
||||||
|
if(maxHealth < val)
|
||||||
|
val = maxHealth;
|
||||||
|
}
|
||||||
|
|
||||||
SetUInt32Value(UNIT_FIELD_HEALTH, val);
|
SetUInt32Value(UNIT_FIELD_HEALTH, val);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user