]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Yippee!
authorScarKy0 <scarky0@onet.eu>
Thu, 14 Nov 2024 16:53:15 +0000 (17:53 +0100)
committerScarKy0 <scarky0@onet.eu>
Thu, 14 Nov 2024 16:53:15 +0000 (17:53 +0100)
Content.Server/Silicons/Laws/SiliconLawSystem.cs

index a4a7ee528f70978af25fd83f742e6046a893a5a5..9b3e279b75e135166077062bed57193466bbcf2b 100644 (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);
     }