Merge pull request #4489 from devilcoredev/fix_001
Core/Achievemens: Fix 'The Undying' and 'The Immortal' achievements
This commit is contained in:
@@ -1507,9 +1507,6 @@ void Creature::setDeathState(DeathState s)
|
||||
if (m_formation && m_formation->getLeader() == this)
|
||||
m_formation->FormationReset(true);
|
||||
|
||||
if (ZoneScript* zoneScript = GetZoneScript())
|
||||
zoneScript->OnCreatureDeath(this);
|
||||
|
||||
if ((canFly() || IsFlying()) && FallGround())
|
||||
return;
|
||||
|
||||
|
||||
@@ -12764,6 +12764,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)
|
||||
|
||||
@@ -37,7 +37,7 @@ class ZoneScript
|
||||
virtual void OnGameObjectCreate(GameObject* /*go*/) {}
|
||||
virtual void OnGameObjectRemove(GameObject* /*go*/) {}
|
||||
|
||||
virtual void OnCreatureDeath(Creature* /*creature*/) {}
|
||||
virtual void OnUnitDeath(Unit* /*unit*/) {}
|
||||
|
||||
//All-purpose data storage 64 bit
|
||||
virtual uint64 GetData64(uint32 /*DataId*/) { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user