Core/SmartAI: Fixed crashes when using timed actionlist for gameobjects.

This commit is contained in:
kaelima
2011-12-10 13:44:06 +01:00
parent 100bcd6aec
commit b10477a166
2 changed files with 4 additions and 4 deletions

View File

@@ -707,7 +707,7 @@ void SmartAI::SetRun(bool run)
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
else
me->AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
me->SendMovementFlagUpdate();
mRun = run;
}

View File

@@ -1493,7 +1493,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
else if (GameObject* goTarget = (*itr)->ToGameObject())
{
if (IsSmartGO(goTarget))
CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
}
}
@@ -1610,7 +1610,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
else if (GameObject* goTarget = (*itr)->ToGameObject())
{
if (IsSmartGO(goTarget))
CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker());
CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
}
}
@@ -1640,7 +1640,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
else if (GameObject* goTarget = (*itr)->ToGameObject())
{
if (IsSmartGO(goTarget))
CAST_AI(SmartGameObjectAI, target->AI())->SetScript9(e, id, GetLastInvoker());
CAST_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
}
}