From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Tue, 2 Dec 2025 14:51:59 +0000 (-0800) Subject: Fix Mothership cannot use their tools and BorgSystem cleanup. (#41673) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=a76a3c966e4e6a3cdd5f5aa0b318014f706e623c;p=space-station-14.git Fix Mothership cannot use their tools and BorgSystem cleanup. (#41673) Fixe Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Shared/Silicons/Borgs/SharedBorgSystem.API.cs b/Content.Shared/Silicons/Borgs/SharedBorgSystem.API.cs index 821ef35d8d..3f86abb568 100644 --- a/Content.Shared/Silicons/Borgs/SharedBorgSystem.API.cs +++ b/Content.Shared/Silicons/Borgs/SharedBorgSystem.API.cs @@ -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; } /// diff --git a/Content.Shared/Silicons/Borgs/SharedBorgSystem.cs b/Content.Shared/Silicons/Borgs/SharedBorgSystem.cs index d965a362ff..71818ca211 100644 --- a/Content.Shared/Silicons/Borgs/SharedBorgSystem.cs +++ b/Content.Shared/Silicons/Borgs/SharedBorgSystem.cs @@ -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 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 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 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)); } } }