diff --git a/Content.Shared/Follower/FollowerSystem.cs b/Content.Shared/Follower/FollowerSystem.cs index 339136ffe8..38c0e5ada3 100644 --- a/Content.Shared/Follower/FollowerSystem.cs +++ b/Content.Shared/Follower/FollowerSystem.cs @@ -33,6 +33,8 @@ public sealed class FollowerSystem : EntitySystem SubscribeLocalEvent>(OnGetAlternativeVerbs); SubscribeLocalEvent(OnFollowerMove); SubscribeLocalEvent(OnPullStarted); + SubscribeLocalEvent(OnFollowerTerminating); + SubscribeLocalEvent(OnGotEquippedHand); SubscribeLocalEvent(OnFollowedTerminating); SubscribeLocalEvent(OnBeforeSave); @@ -107,6 +109,11 @@ public sealed class FollowerSystem : EntitySystem StopFollowingEntity(uid, component.Following, deparent:false); } + private void OnFollowerTerminating(EntityUid uid, FollowerComponent component, ref EntityTerminatingEvent args) + { + StopFollowingEntity(uid, component.Following, deparent: false); + } + // Since we parent our observer to the followed entity, we need to detach // before they get deleted so that we don't get recursively deleted too. private void OnFollowedTerminating(EntityUid uid, FollowedComponent component, ref EntityTerminatingEvent args) @@ -186,7 +193,7 @@ public sealed class FollowerSystem : EntitySystem RaiseLocalEvent(uid, uidEv, true); RaiseLocalEvent(target, targetEv, false); - Dirty(followed); + Dirty(target, followed); RaiseLocalEvent(uid, uidEv); RaiseLocalEvent(target, targetEv);