diff --git a/Content.Server/Silicons/Laws/SiliconLawSystem.cs b/Content.Server/Silicons/Laws/SiliconLawSystem.cs index a4a7ee528f..9b3e279b75 100644 --- a/Content.Server/Silicons/Laws/SiliconLawSystem.cs +++ b/Content.Server/Silicons/Laws/SiliconLawSystem.cs @@ -75,14 +75,14 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem { if (!component.Subverted) return; - EnsureSubvertedSiliconRole(uid); + EnsureSubvertedSiliconRole(args.Mind); } private void OnLawProviderMindRemoved(EntityUid uid, SiliconLawProviderComponent component, MindRemovedMessage args) { if (!component.Subverted) return; - RemoveSubvertedSiliconRole(uid); + RemoveSubvertedSiliconRole(args.Mind); } @@ -179,21 +179,14 @@ public sealed class SiliconLawSystem : SharedSiliconLawSystem } - private void EnsureSubvertedSiliconRole(EntityUid uid) + private void EnsureSubvertedSiliconRole(EntityUid mindId) { - if (!_mind.TryGetMind(uid, out var mindId, out _)) - return; - if (!_roles.MindHasRole(mindId)) _roles.MindAddRole(mindId, "MindRoleSubvertedSilicon"); - } - private void RemoveSubvertedSiliconRole(EntityUid uid) + private void RemoveSubvertedSiliconRole(EntityUid mindId) { - if (!_mind.TryGetMind(uid, out var mindId, out _)) - return; - if (_roles.MindHasRole(mindId)) _roles.MindTryRemoveRole(mindId); }