refactor(Core/Movement): follower management of references (#25060)
Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -20,9 +20,13 @@
|
||||
|
||||
void AbstractFollower::SetTarget(Unit* unit)
|
||||
{
|
||||
if (unit == GetTarget())
|
||||
if (unit == _target)
|
||||
return;
|
||||
|
||||
i_target.link(unit, this);
|
||||
_target = i_target.getTarget();
|
||||
if (_target)
|
||||
_target->FollowerRemoved(this);
|
||||
|
||||
_target = unit;
|
||||
if (_target)
|
||||
_target->FollowerAdded(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user