From a6d8c93a16404504eab8fa90538f6e1643e6fb16 Mon Sep 17 00:00:00 2001 From: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> Date: Sun, 14 Mar 2021 19:28:44 -0700 Subject: [PATCH] Fix gib pulling player back from ghost (#3664) --- Content.Server/Mobs/Mind.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/Mobs/Mind.cs b/Content.Server/Mobs/Mind.cs index 4cdcdd5128..36b625ef00 100644 --- a/Content.Server/Mobs/Mind.cs +++ b/Content.Server/Mobs/Mind.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; using Content.Server.GameObjects.Components.Mobs; +using Content.Server.GameObjects.Components.Observer; using Content.Server.Mobs.Roles; using Content.Server.Objectives; using Content.Server.Players; @@ -225,13 +226,14 @@ namespace Content.Server.Mobs OwnedComponent = component; OwnedComponent?.InternalAssignMind(this); + if (VisitingEntity?.HasComponent() == false) + VisitingEntity = null; + // Player is CURRENTLY connected. - if (Session != null && !alreadyAttached) + if (Session != null && !alreadyAttached && VisitingEntity == null) { Session.AttachToEntity(entity); } - - VisitingEntity = null; } public void RemoveOwningPlayer()