From af08e91bbfcf744f66020db4d0d2d58957e79011 Mon Sep 17 00:00:00 2001 From: faint <46868845+ficcialfaint@users.noreply.github.com> Date: Mon, 22 May 2023 16:19:36 +0300 Subject: [PATCH] PAI ghost role fix (#16674) --- Content.Server/PAI/PAISystem.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Server/PAI/PAISystem.cs b/Content.Server/PAI/PAISystem.cs index 5f89c45213..016a569dd9 100644 --- a/Content.Server/PAI/PAISystem.cs +++ b/Content.Server/PAI/PAISystem.cs @@ -78,7 +78,7 @@ namespace Content.Server.PAI EntityManager.GetComponent(component.Owner).EntityName = val; - var ghostRole = AddComp(uid); + var ghostRole = EnsureComp(uid); EnsureComp(uid); ghostRole.RoleName = Loc.GetString("pai-system-role-name"); @@ -165,6 +165,7 @@ namespace Content.Server.PAI if (EntityManager.HasComponent(uid)) { EntityManager.RemoveComponent(uid); + EntityManager.RemoveComponent(uid); _popupSystem.PopupEntity(Loc.GetString("pai-system-stopped-searching"), uid, args.User); PAITurningOff(uid); }