Remove ghost role component references (#15262)

This commit is contained in:
DrSmugleaf
2023-04-12 06:32:14 -07:00
committed by GitHub
parent 284f6b99b9
commit 9146374e39
30 changed files with 258 additions and 182 deletions

View File

@@ -1,8 +1,7 @@
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind.Components;
using Content.Server.Speech.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Server.Ghost.Roles.Components;
namespace Content.Server.Chemistry.ReagentEffects;
@@ -26,16 +25,18 @@ public sealed class MakeSentient : ReagentEffect
}
// No idea what anything past this point does
if (entityManager.TryGetComponent(uid, out GhostTakeoverAvailableComponent? takeOver))
if (entityManager.TryGetComponent(uid, out GhostRoleComponent? ghostRole) ||
entityManager.TryGetComponent(uid, out GhostTakeoverAvailableComponent? takeOver))
{
return;
}
takeOver = entityManager.AddComponent<GhostTakeoverAvailableComponent>(uid);
ghostRole = entityManager.AddComponent<GhostRoleComponent>(uid);
entityManager.AddComponent<GhostTakeoverAvailableComponent>(uid);
var entityData = entityManager.GetComponent<MetaDataComponent>(uid);
takeOver.RoleName = entityData.EntityName;
takeOver.RoleDescription = Loc.GetString("ghost-role-information-cognizine-description");
ghostRole.RoleName = entityData.EntityName;
ghostRole.RoleDescription = Loc.GetString("ghost-role-information-cognizine-description");
}
}