]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix borg hands showing up in stripping menu (#32606)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Thu, 3 Oct 2024 00:11:56 +0000 (02:11 +0200)
committerGitHub <noreply@github.com>
Thu, 3 Oct 2024 00:11:56 +0000 (02:11 +0200)
* Fix borg hands showing up in stripping menu

Borgs can't drop their items anyways, and the amount of hands borgs have causes the UI to just bug out.

* Add more checks

Content.Client/Inventory/StrippableBoundUserInterface.cs
Content.Shared/Hands/Components/HandsComponent.cs
Content.Shared/Strip/SharedStrippableSystem.cs
Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml

index 97172f8de8c24f40cef28b25e6408368dfbbd5d3..2ce07758c9641d5044f97a4e9b481191774d2f73 100644 (file)
@@ -98,7 +98,7 @@ namespace Content.Client.Inventory
                 }
             }
 
-            if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp))
+            if (EntMan.TryGetComponent<HandsComponent>(Owner, out var handsComp) && handsComp.CanBeStripped)
             {
                 // good ol hands shit code. there is a GuiHands comparer that does the same thing... but these are hands
                 // and not gui hands... which are different...
index f218455c0bb7dc584b2158a3e53a45f321c1cde3..b3cb51ae359ec3b1de4c0b9dc66260a541c815d5 100644 (file)
@@ -80,6 +80,12 @@ public sealed partial class HandsComponent : Component
 
     [DataField]
     public DisplacementData? HandDisplacement;
+
+    /// <summary>
+    /// If false, hands cannot be stripped, and they do not show up in the stripping menu.
+    /// </summary>
+    [DataField]
+    public bool CanBeStripped = true;
 }
 
 [Serializable, NetSerializable]
index a68bf755d429e9da443ae6e9088c2a485ec2ec45..e1c3d8ef0d86c8781a89ccbd2797d30d0fb59aac 100644 (file)
@@ -118,6 +118,9 @@ public abstract class SharedStrippableSystem : EntitySystem
             !Resolve(target, ref targetStrippable))
             return;
 
+        if (!target.Comp.CanBeStripped)
+            return;
+
         if (!_handsSystem.TryGetHand(target.Owner, handId, out var handSlot))
             return;
 
@@ -349,6 +352,9 @@ public abstract class SharedStrippableSystem : EntitySystem
             !Resolve(target, ref target.Comp))
             return false;
 
+        if (!target.Comp.CanBeStripped)
+            return false;
+
         if (user.Comp.ActiveHand == null)
             return false;
 
@@ -449,6 +455,9 @@ public abstract class SharedStrippableSystem : EntitySystem
         if (!Resolve(target, ref target.Comp))
             return false;
 
+        if (!target.Comp.CanBeStripped)
+            return false;
+
         if (!_handsSystem.TryGetHand(target, handName, out var handSlot, target.Comp))
         {
             _popupSystem.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message", ("owner", Identity.Name(target, EntityManager, user))));
index 54bd58af78f3644469a09f2d38b073d637f5404e..c65db8fe19fbb484a437c0fb7ed51a010074a038 100644 (file)
@@ -85,6 +85,7 @@
   - type: Hands
     showInHands: false
     disableExplosionRecursion: true
+    canBeStripped: false
   - type: ComplexInteraction
   - type: IntrinsicRadioReceiver
   - type: IntrinsicRadioTransmitter