fix(Core/Misc): Memleaks fixes. Part I. (#5546)

This commit is contained in:
UltraNix
2021-04-30 17:03:02 +02:00
committed by GitHub
parent 632883538c
commit adad43a15c
9 changed files with 51 additions and 37 deletions

View File

@@ -364,14 +364,14 @@ void MotionMaster::MoveCircleTarget(Unit* target)
return;
}
Position* point = target->GetMeleeAttackPoint(_owner);
if (point == nullptr)
Position pos;
if (!target->GetMeleeAttackPoint(_owner, pos))
{
return;
}
Movement::MoveSplineInit init(_owner);
init.MoveTo(point->m_positionX, point->m_positionY, point->m_positionZ, false);
init.MoveTo(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), false);
init.SetWalk(true);
init.SetFacing(target);
init.Launch();