mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 11:43:18 -04:00
Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
This commit is contained in:
@@ -1594,10 +1594,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
float attackAngle = float(e.action.setRangedMovement.angle) / 180.0f * float(M_PI);
|
||||
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (Creature* creature = target->ToCreature())
|
||||
if (IsSmart(creature) && creature->GetVictim())
|
||||
if (ENSURE_AI(SmartAI, creature->AI())->CanCombatMove())
|
||||
creature->GetMotionMaster()->MoveChase(creature->GetVictim(), attackDistance, attackAngle);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -2230,16 +2232,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
target->ToUnit()->RemoveAllGameObjects();
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_STOP_MOTION:
|
||||
case SMART_ACTION_REMOVE_MOVEMENT:
|
||||
{
|
||||
for (WorldObject* const target : targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
if (e.action.stopMotion.stopMovement)
|
||||
if (e.action.removeMovement.movementType && e.action.removeMovement.movementType < MAX_MOTION_TYPE)
|
||||
target->ToUnit()->GetMotionMaster()->Remove(MovementGeneratorType(e.action.removeMovement.movementType));
|
||||
if (e.action.removeMovement.forced)
|
||||
target->ToUnit()->StopMoving();
|
||||
if (e.action.stopMotion.movementExpired)
|
||||
target->ToUnit()->GetMotionMaster()->MovementExpired();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user