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

View File

@@ -162,9 +162,12 @@ void PointMovementGenerator<T>::DoFinalize(T* unit)
{
unit->ClearUnitState(UNIT_STATE_CHARGING);
if (Unit* target = ObjectAccessor::GetUnit(*unit, _chargeTargetGUID))
if (_chargeTargetGUID && _chargeTargetGUID == unit->GetTarget())
{
unit->Attack(target, true);
if (Unit* target = ObjectAccessor::GetUnit(*unit, _chargeTargetGUID))
{
unit->Attack(target, true);
}
}
}