Make wielding automatically drop the item on your other hand (#27975)
* Make wielding automatically drop the item on your other hand * Fix docs * Remove redundant parameter * Fix not deleting virtuals on fail * Make count freeable hands method * Add popup when dropping item
This commit is contained in:
@@ -5,7 +5,6 @@ using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Inventory.VirtualItem;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Storage.EntitySystems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Input.Binding;
|
||||
@@ -299,4 +298,16 @@ public abstract partial class SharedHandsSystem
|
||||
|
||||
return hands.Hands.TryGetValue(handId, out hand);
|
||||
}
|
||||
|
||||
public int CountFreeableHands(Entity<HandsComponent> hands)
|
||||
{
|
||||
var freeable = 0;
|
||||
foreach (var hand in hands.Comp.Hands.Values)
|
||||
{
|
||||
if (hand.IsEmpty || CanDropHeld(hands, hand))
|
||||
freeable++;
|
||||
}
|
||||
|
||||
return freeable;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user