fix wieldable guns not being able to cycle inhand (#27307)
* Add UnwieldOverride variable that overrides unwielding inhand to enable other interactions * Give LMGs UnwieldOverride * logically inverted UnwieldOverride to UnwieldOnUse * fixed typo
This commit is contained in:
@@ -26,6 +26,13 @@ public sealed partial class WieldableComponent : Component
|
|||||||
[AutoNetworkedField, DataField("wielded")]
|
[AutoNetworkedField, DataField("wielded")]
|
||||||
public bool Wielded = false;
|
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")]
|
[DataField("wieldedInhandPrefix")]
|
||||||
public string? WieldedInhandPrefix = "wielded";
|
public string? WieldedInhandPrefix = "wielded";
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public sealed class WieldableSystem : EntitySystem
|
|||||||
|
|
||||||
if (!component.Wielded)
|
if (!component.Wielded)
|
||||||
args.Handled = TryWield(uid, component, args.User);
|
args.Handled = TryWield(uid, component, args.User);
|
||||||
else
|
else if (component.UnwieldOnUse)
|
||||||
args.Handled = TryUnwield(uid, component, args.User);
|
args.Handled = TryUnwield(uid, component, args.User);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
slots:
|
slots:
|
||||||
- Back
|
- Back
|
||||||
- type: Wieldable
|
- type: Wieldable
|
||||||
|
unwieldOnUse: false
|
||||||
- type: GunWieldBonus
|
- type: GunWieldBonus
|
||||||
minAngle: -20
|
minAngle: -20
|
||||||
maxAngle: -20
|
maxAngle: -20
|
||||||
|
|||||||
Reference in New Issue
Block a user