fix(Core/Creatures): Fixed loading transform auras from DB. (#13489)

Fixes #13472
This commit is contained in:
UltraNix
2022-10-27 10:23:51 +02:00
committed by GitHub
parent 5338117e0d
commit 93796bb01d

View File

@@ -1139,8 +1139,6 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
break;
}
LoadCreaturesAddon();
uint32 displayID = GetNativeDisplayId();
if (sObjectMgr->GetCreatureModelRandomGender(&displayID) && !IsTotem()) // Cancel load if no model defined or if totem
{
@@ -1148,6 +1146,8 @@ bool Creature::Create(ObjectGuid::LowType guidlow, Map* map, uint32 phaseMask, u
SetNativeDisplayId(displayID);
}
LoadCreaturesAddon();
//! Need to be called after LoadCreaturesAddon - MOVEMENTFLAG_HOVER is set there
m_positionZ += GetHoverHeight();
@@ -2031,11 +2031,15 @@ void Creature::Respawn(bool force)
setDeathState(JUST_RESPAWNED);
// MDic - Acidmanifesto
uint32 displayID = GetNativeDisplayId();
if (sObjectMgr->GetCreatureModelRandomGender(&displayID)) // Cancel load if no model defined
// Do not override transform auras
if (GetAuraEffectsByType(SPELL_AURA_TRANSFORM).empty())
{
SetDisplayId(displayID);
SetNativeDisplayId(displayID);
uint32 displayID = GetNativeDisplayId();
if (sObjectMgr->GetCreatureModelRandomGender(&displayID)) // Cancel load if no model defined
{
SetDisplayId(displayID);
SetNativeDisplayId(displayID);
}
}
GetMotionMaster()->InitDefault();