]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix wieldable guns not being able to cycle inhand (#27307)
authorWarMechanic <69510347+WarMechanic@users.noreply.github.com>
Fri, 26 Apr 2024 12:31:50 +0000 (22:31 +1000)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 12:31:50 +0000 (08:31 -0400)
* Add UnwieldOverride variable that overrides unwielding inhand to enable other interactions

* Give LMGs UnwieldOverride

* logically inverted UnwieldOverride to UnwieldOnUse

* fixed typo

Content.Shared/Wieldable/Components/WieldableComponent.cs
Content.Shared/Wieldable/WieldableSystem.cs
Resources/Prototypes/Entities/Objects/Weapons/Guns/LMGs/lmgs.yml

index 4a50b930722b3c7d8c06ab9a078611ed03be77f6..5dc6abbbbea5edbadbfa08c8a71d051bc8ebf6c3 100644 (file)
@@ -26,6 +26,13 @@ public sealed partial class WieldableComponent : Component
     [AutoNetworkedField, DataField("wielded")]
     public bool Wielded = false;
 
+    /// <summary>
+    ///     Whether using the item inhand while wielding causes the item to unwield.
+    ///     Unwielding can conflict with other inhand actions. 
+    /// </summary>
+    [DataField]
+    public bool UnwieldOnUse = true;
+
     [DataField("wieldedInhandPrefix")]
     public string? WieldedInhandPrefix = "wielded";
 
index 6bd406c1cadccc53a90d2a311e4b7dda1dd21e9c..ba3f787a4bbd8c3372a1f074845ecd7b35c4e7e5 100644 (file)
@@ -125,7 +125,7 @@ public sealed class WieldableSystem : EntitySystem
 
         if (!component.Wielded)
             args.Handled = TryWield(uid, component, args.User);
-        else
+        else if (component.UnwieldOnUse)
             args.Handled = TryUnwield(uid, component, args.User);
     }
 
index 49b2eeaada1370f9d0d539176a9e6de4abfdfbc9..79f2e7b45f566d0df14fb348040bd0c6aeebaafc 100644 (file)
@@ -14,6 +14,7 @@
     slots:
     - Back
   - type: Wieldable
+    unwieldOnUse: false
   - type: GunWieldBonus
     minAngle: -20
     maxAngle: -20