mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/SAI: Fix previous commit. Thanks Shauren for notifying.
This commit is contained in:
@@ -1536,11 +1536,23 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
break;
|
||||
case SMART_ACTION_SET_RANGED_MOVEMENT:
|
||||
{
|
||||
if (!IsSmart())
|
||||
break;
|
||||
|
||||
float attackDistance = (float)e.action.setRangedMovement.distance;
|
||||
float attackAngle = e.action.setRangedMovement.angle / 180.0f * M_PI;
|
||||
|
||||
if (CAST_AI(SmartAI, me->AI())->CanCombatMove())
|
||||
me->GetMotionMaster()->MoveChase(me->getVictim(), attackDistance, attackAngle);
|
||||
ObjectList* targets = GetTargets(e, unit);
|
||||
if (targets)
|
||||
{
|
||||
for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr)
|
||||
if (Creature* target = (*itr)->ToCreature())
|
||||
if (IsSmart(target) && target->getVictim())
|
||||
if (CAST_AI(SmartAI, target->AI())->CanCombatMove())
|
||||
target->GetMotionMaster()->MoveChase(target->getVictim(), attackDistance, attackAngle);
|
||||
|
||||
delete targets;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_CALL_TIMED_ACTIONLIST:
|
||||
|
||||
Reference in New Issue
Block a user