Fix borg hands showing up in stripping menu (#32606)
* 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
This commit is contained in:
committed by
GitHub
parent
440742f8f7
commit
2d644095e3
@@ -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
|
// 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...
|
// and not gui hands... which are different...
|
||||||
|
|||||||
@@ -80,6 +80,12 @@ public sealed partial class HandsComponent : Component
|
|||||||
|
|
||||||
[DataField]
|
[DataField]
|
||||||
public DisplacementData? HandDisplacement;
|
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]
|
[Serializable, NetSerializable]
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ public abstract class SharedStrippableSystem : EntitySystem
|
|||||||
!Resolve(target, ref targetStrippable))
|
!Resolve(target, ref targetStrippable))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!target.Comp.CanBeStripped)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!_handsSystem.TryGetHand(target.Owner, handId, out var handSlot))
|
if (!_handsSystem.TryGetHand(target.Owner, handId, out var handSlot))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -349,6 +352,9 @@ public abstract class SharedStrippableSystem : EntitySystem
|
|||||||
!Resolve(target, ref target.Comp))
|
!Resolve(target, ref target.Comp))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!target.Comp.CanBeStripped)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (user.Comp.ActiveHand == null)
|
if (user.Comp.ActiveHand == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@@ -449,6 +455,9 @@ public abstract class SharedStrippableSystem : EntitySystem
|
|||||||
if (!Resolve(target, ref target.Comp))
|
if (!Resolve(target, ref target.Comp))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!target.Comp.CanBeStripped)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!_handsSystem.TryGetHand(target, handName, out var handSlot, target.Comp))
|
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))));
|
_popupSystem.PopupCursor(Loc.GetString("strippable-component-item-slot-free-message", ("owner", Identity.Name(target, EntityManager, user))));
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
- type: Hands
|
- type: Hands
|
||||||
showInHands: false
|
showInHands: false
|
||||||
disableExplosionRecursion: true
|
disableExplosionRecursion: true
|
||||||
|
canBeStripped: false
|
||||||
- type: ComplexInteraction
|
- type: ComplexInteraction
|
||||||
- type: IntrinsicRadioReceiver
|
- type: IntrinsicRadioReceiver
|
||||||
- type: IntrinsicRadioTransmitter
|
- type: IntrinsicRadioTransmitter
|
||||||
|
|||||||
Reference in New Issue
Block a user