From 57bdbdc0ca8e867520de9927389edb703a04c43a Mon Sep 17 00:00:00 2001 From: n0n4m3 Date: Sat, 19 Dec 2009 17:48:45 +0100 Subject: Add function to update orientation of unit (for both server andclient). by NoFantasy --HG-- branch : trunk --- src/game/Unit.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 117c64d61de..e0cda1b56a9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3517,6 +3517,17 @@ bool Unit::isInBackInMap(Unit const* target, float distance, float arc) const return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI - arc, target ); } +void Unit::SetFacingToObject(WorldObject* pObject) +{ + // update orientation at server + SetOrientation(GetAngle(pObject)); + + // and client + WorldPacket data; + BuildHeartBeatMsg(&data); + SendMessageToSet(&data, false); +} + bool Unit::isInAccessiblePlaceFor(Creature const* c) const { if(IsInWater()) -- cgit v1.2.3