From 7d38088860b904d53325e39a067d405143502e03 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sat, 5 Dec 2009 11:12:21 +0100 Subject: [PATCH] Add function to change orientation or set in front of some unit. It also send packet with move update, so client also will see that creature change orientation. --HG-- branch : trunk --- src/game/Unit.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/Unit.h b/src/game/Unit.h index 98db6a9b5f..91ec54d1d6 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1622,6 +1622,18 @@ class TRINITY_DLL_SPEC Unit : public WorldObject SetOrientation(GetAngle(target)); } bool isInBackInMap(Unit const* target, float distance, float arc = M_PI) const; + void ChangeOrient(float fAngle, Unit* pUnit = NULL) + { + if(!this) + return; + + if(!pUnit) + this->SetOrientation(fAngle); + else + this->SetInFront(pUnit); + + this->SendMovementFlagUpdate(); + } // Visibility system UnitVisibility GetVisibility() const { return m_Visibility; }