This commit is contained in:
ScarKy0
2024-11-14 17:53:15 +01:00
parent 0f30639cf2
commit ace158df0e

View File

@@ -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<SubvertedSiliconRoleComponent>(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<SubvertedSiliconRoleComponent>(mindId))
_roles.MindTryRemoveRole<SubvertedSiliconRoleComponent>(mindId);
}