aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRat <none@none>2010-11-05 21:34:26 +0100
committerRat <none@none>2010-11-05 21:34:26 +0100
commit9b3ce64f6e5c073a1e7a123af42c5cd1dee18a48 (patch)
treede9bfa4780f1ab251d297ac7ced3a34f0d078563 /src
parentbe25e38144ba5d89e82f22829c3143d3f4f0bef7 (diff)
Core/SmartAI: added option to reset orientation (use ACTION_SET_ORIENTATION with TARGET_SELF to reset to spawn orientation)
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index 2933f8b4109..b9bd0aeedea 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -870,7 +870,9 @@ void SmartScript::ProcessAction(SmartScriptHolder &e, Unit* unit, uint32 var0, u
{
if (!me) return;
ObjectList* targets = GetTargets(e, unit);
- if (e.GetTargetType() == SMART_TARGET_POSITION)
+ if (e.GetTargetType() == SMART_TARGET_SELF)
+ me->SetFacing(me->GetCreatureData()->orientation, NULL);
+ else if (e.GetTargetType() == SMART_TARGET_POSITION)
me->SetFacing(e.target.o, NULL);
else if (targets && !targets->empty())
me->SetFacing(0, (*targets->begin()));