Core/SmartAI: added option to reset orientation (use ACTION_SET_ORIENTATION with TARGET_SELF to reset to spawn orientation)

--HG--
branch : trunk
This commit is contained in:
Rat
2010-11-05 21:34:26 +01:00
parent be25e38144
commit 9b3ce64f6e

View File

@@ -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()));