Arachnid zombie hands fix (#19073)

* zombie hands begone

* the shortening

* Move it to SharedHandsSystem

* do the requested changes
This commit is contained in:
PixelTK
2023-08-13 20:51:20 +01:00
committed by GitHub
parent 080e923583
commit 1e36976d3a
2 changed files with 30 additions and 11 deletions

View File

@@ -77,6 +77,32 @@ public abstract partial class SharedHandsSystem : EntitySystem
Dirty(handsComp);
}
/// <summary>
/// Gets rid of all the entity's hands.
/// </summary>
/// <param name="uid"></param>
/// <param name="handsComp"></param>
public void RemoveHands(EntityUid uid, HandsComponent? handsComp = null)
{
if (!Resolve(uid, ref handsComp))
return;
RemoveHands(uid, EnumerateHands(uid), handsComp);
}
private void RemoveHands(EntityUid uid, IEnumerable<Hand> hands, HandsComponent handsComp)
{
if (!hands.Any())
return;
var hand = hands.First();
RemoveHand(uid, hand.Name, handsComp);
// Repeats it for any additional hands.
RemoveHands(uid, hands, handsComp);
}
private void HandleSetHand(RequestSetHandEvent msg, EntitySessionEventArgs eventArgs)
{
if (eventArgs.SenderSession.AttachedEntity == null)