From 9b3ce64f6e5c073a1e7a123af42c5cd1dee18a48 Mon Sep 17 00:00:00 2001 From: Rat Date: Fri, 5 Nov 2010 21:34:26 +0100 Subject: [PATCH] Core/SmartAI: added option to reset orientation (use ACTION_SET_ORIENTATION with TARGET_SELF to reset to spawn orientation) --HG-- branch : trunk --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 2933f8b410..b9bd0aeede 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()));