fix(Core/Spells): auto attack only selected target when charge is over (#10541)

Fixes #10353
This commit is contained in:
UltraNix
2022-02-24 15:54:43 +01:00
committed by GitHub
parent 23cd1883d6
commit a980bd38a9
@@ -162,11 +162,14 @@ void PointMovementGenerator<T>::DoFinalize(T* unit)
{ {
unit->ClearUnitState(UNIT_STATE_CHARGING); unit->ClearUnitState(UNIT_STATE_CHARGING);
if (_chargeTargetGUID && _chargeTargetGUID == unit->GetTarget())
{
if (Unit* target = ObjectAccessor::GetUnit(*unit, _chargeTargetGUID)) if (Unit* target = ObjectAccessor::GetUnit(*unit, _chargeTargetGUID))
{ {
unit->Attack(target, true); unit->Attack(target, true);
} }
} }
}
if (unit->movespline->Finalized()) if (unit->movespline->Finalized())
MovementInform(unit); MovementInform(unit);