From cd6fa62606bb978c1bffbd82abadc8c65707b691 Mon Sep 17 00:00:00 2001 From: Ovahlord Date: Thu, 11 Oct 2018 20:43:59 +0200 Subject: [PATCH] Core/Units: keep serverside orientation up to date while tracking a channel target --- src/server/game/Entities/Unit/Unit.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index ef32277d2f..91e76ec224 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -521,6 +521,13 @@ void Unit::Update(uint32 p_time) UpdateSplineMovement(p_time); i_motionMaster->UpdateMotion(p_time); + + // 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)); } bool Unit::haveOffhandWeapon() const