Core/Spells: moved updating channeled orientation for tracking channel spells to creature class

This commit is contained in:
Ovahlord
2019-05-18 01:03:28 +02:00
parent 0312146ace
commit d8787c0d1b

View File

@@ -804,6 +804,13 @@ void Creature::Update(uint32 diff)
m_regenTimer = CREATURE_REGEN_INTERVAL;
}
// Update serverside orientation of channeled spells that are suposed to track the channel target
if (Spell const* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
if (spell->GetSpellInfo()->HasAttribute(SPELL_ATTR1_CHANNEL_TRACK_TARGET))
if (ObjectGuid guid = GetChannelObjectGuid())
if (WorldObject* target = ObjectAccessor::GetWorldObject(*this, guid))
SetOrientation(GetAngle(target));
if (CanNotReachTarget() && !IsInEvadeMode() && !GetMap()->IsRaid())
{
m_cannotReachTimer += diff;