]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Mothership cannot use their tools and BorgSystem cleanup. (#41673)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Tue, 2 Dec 2025 14:51:59 +0000 (06:51 -0800)
committerGitHub <noreply@github.com>
Tue, 2 Dec 2025 14:51:59 +0000 (14:51 +0000)
Fixe

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Silicons/Borgs/SharedBorgSystem.API.cs
Content.Shared/Silicons/Borgs/SharedBorgSystem.cs

index 821ef35d8d0341c5b2e36185132737edcf7ae955..3f86abb5682a7a4f49309ee7e48784386e59e0aa 100644 (file)
@@ -24,7 +24,7 @@ public abstract partial class SharedBorgSystem
         if (!_mind.TryGetMind(chassis.Owner, out _, out _))
             return false;
 
-        if (!_mobState.IsAlive(chassis.Owner))
+        if (_mobState.IsIncapacitated(chassis.Owner))
             return false;
 
         return true;
@@ -39,13 +39,12 @@ public abstract partial class SharedBorgSystem
         if (chassis.Comp.Active)
             return false; // Already active.
 
-        if (CanActivate(chassis))
-        {
-            SetActive(chassis, true, user);
-            return true;
-        }
+        if (!CanActivate(chassis))
+            return false;
+
+        SetActive(chassis, true, user);
+        return true;
 
-        return false;
     }
 
     /// <summary>
index d965a362ff6a24286b661367a6a484ffe47b5b80..71818ca211d7300bda5925ea62e72b564abd1a1c 100644 (file)
@@ -197,8 +197,8 @@ public abstract partial class SharedBorgSystem : EntitySystem
         // Unpredicted because the event is raised on the server.
         _popup.PopupEntity(Loc.GetString("borg-mind-added", ("name", Identity.Name(chassis.Owner, EntityManager))), chassis.Owner);
 
-        if (CanActivate(chassis))
-            SetActive(chassis, true);
+        TryActivate(chassis);
+
         _appearance.SetData(chassis.Owner, BorgVisuals.HasPlayer, true);
     }
 
@@ -285,14 +285,9 @@ public abstract partial class SharedBorgSystem : EntitySystem
     private void OnMobStateChanged(Entity<BorgChassisComponent> chassis, ref MobStateChangedEvent args)
     {
         if (args.NewMobState == MobState.Alive)
-        {
-            if (CanActivate(chassis))
-                SetActive(chassis, true, user: args.Origin);
-        }
+            TryActivate(chassis, args.Origin);
         else
-        {
             SetActive(chassis, false, user: args.Origin);
-        }
     }
 
     private void OnBeingGibbed(Entity<BorgChassisComponent> chassis, ref BeingGibbedEvent args)
@@ -357,8 +352,7 @@ public abstract partial class SharedBorgSystem : EntitySystem
     // Raised when a power cell is inserted.
     private void OnPowerCellChanged(Entity<BorgChassisComponent> chassis, ref PowerCellChangedEvent args)
     {
-        if (CanActivate(chassis))
-            SetActive(chassis, true);
+        TryActivate(chassis);
     }
 
     public override void Update(float frameTime)
@@ -374,8 +368,7 @@ public abstract partial class SharedBorgSystem : EntitySystem
             Dirty(uid, borgChassis);
 
             // If we aren't drawing and suddenly get enough power to draw again, reenable.
-            if (CanActivate((uid, borgChassis)))
-                SetActive((uid, borgChassis), true);
+            TryActivate((uid, borgChassis));
         }
     }
 }