Fix 'The Undying' and 'The Immortal' achievements.

This commit is contained in:
Giuseppe Montesanto committed 2012-01-01 04:34:14 +01:00
1 parent ea7b0b064d
commit bf73409f49
8 files changed
+174 -88

No files matched your search

+4
View File
@@ -12750,6 +12750,10 @@ void Unit::setDeathState(DeathState s)
// do not why since in IncreaseMaxHealth currenthealth is checked
SetHealth(0);
SetPower(getPowerType(), 0);
// players in instance don't have ZoneScript, but they have InstanceScript
if (ZoneScript* zoneScript = GetZoneScript() ? GetZoneScript() : (ZoneScript*)GetInstanceScript())
zoneScript->OnUnitDeath(this);
}
else if (s == JUST_ALIVED)
RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground)