diff options
| author | n0n4m3 <none@none> | 2009-12-19 17:48:45 +0100 |
|---|---|---|
| committer | n0n4m3 <none@none> | 2009-12-19 17:48:45 +0100 |
| commit | 57bdbdc0ca8e867520de9927389edb703a04c43a (patch) | |
| tree | 4b34244abdbdb7f142bedbaf5ed77a46c75189de /src/game/Unit.cpp | |
| parent | 2925dfcfc45b836cd6608192c17c8227f6f8fffa (diff) | |
Add function to update orientation of unit (for both server andclient). by NoFantasy
--HG--
branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
| -rw-r--r-- | src/game/Unit.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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()) |
