PAI ghost role fix (#16674)

This commit is contained in:
faint
2023-05-22 16:19:36 +03:00
committed by GitHub
parent 3ed2650e8b
commit af08e91bbf

View File

@@ -78,7 +78,7 @@ namespace Content.Server.PAI
EntityManager.GetComponent<MetaDataComponent>(component.Owner).EntityName = val;
var ghostRole = AddComp<GhostRoleComponent>(uid);
var ghostRole = EnsureComp<GhostRoleComponent>(uid);
EnsureComp<GhostTakeoverAvailableComponent>(uid);
ghostRole.RoleName = Loc.GetString("pai-system-role-name");
@@ -165,6 +165,7 @@ namespace Content.Server.PAI
if (EntityManager.HasComponent<GhostTakeoverAvailableComponent>(uid))
{
EntityManager.RemoveComponent<GhostTakeoverAvailableComponent>(uid);
EntityManager.RemoveComponent<GhostRoleComponent>(uid);
_popupSystem.PopupEntity(Loc.GetString("pai-system-stopped-searching"), uid, args.User);
PAITurningOff(uid);
}