From a45d69e4e49688592905175abf399f973d215f38 Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Sat, 19 Feb 2022 12:16:27 -0700 Subject: [PATCH] Make target ghost warps follow the entity (#6789) --- Content.Server/Ghost/GhostSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 4ba3ebc8c0..a31854723e 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -8,6 +8,7 @@ using Content.Server.Players; using Content.Server.Visible; using Content.Server.Warps; using Content.Shared.Examine; +using Content.Shared.Follower; using Content.Shared.Ghost; using Content.Shared.MobState.Components; using Content.Shared.Movement.EntitySystems; @@ -30,6 +31,7 @@ namespace Content.Server.Ghost [Dependency] private readonly GameTicker _ticker = default!; [Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly VisibilitySystem _visibilitySystem = default!; + [Dependency] private readonly FollowerSystem _followerSystem = default!; public override void Initialize() { @@ -158,6 +160,7 @@ namespace Content.Server.Ghost if (FindLocation(msg.Name) is { } warp) { EntityManager.GetComponent(ghost.Owner).Coordinates = EntityManager.GetComponent(warp.Owner).Coordinates; + return; } Logger.Warning($"User {args.SenderSession.Name} tried to warp to an invalid warp: {msg.Name}"); @@ -178,7 +181,7 @@ namespace Content.Server.Ghost return; } - EntityManager.GetComponent(ghost.Owner).Coordinates = EntityManager.GetComponent(msg.Target).Coordinates; + _followerSystem.StartFollowingEntity(ghost.Owner, msg.Target); } private void DeleteEntity(EntityUid uid)