Еще одни фиксы апстрима (#671)

* wizard appearance system refactor

* new helper method for drop anything from inventory

* fix wizard and nukie inventory saving

* remove wieldable from laser rifle

* replace comment with todo
This commit is contained in:
ThereDrD
2024-08-28 09:54:39 +03:00
committed by GitHub
parent 77574a28e7
commit 2fa46e0b3e
8 changed files with 101 additions and 13 deletions

View File

@@ -1,10 +1,13 @@
using Content.Shared.Explosion;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Inventory;
namespace Content.Server.Inventory
{
public sealed class ServerInventorySystem : InventorySystem
{
[Dependency] private readonly SharedHandsSystem _hands = default!; // WD
public override void Initialize()
{
base.Initialize();
@@ -43,5 +46,24 @@ namespace Content.Server.Inventory
}
// WD EDIT END
}
// WD edit start - new helper method for drop anything from inventory.
public void DropAnything(EntityUid uid)
{
if (TryGetContainerSlotEnumerator(uid, out var enumerator))
{
while (enumerator.MoveNext(out var slot))
{
TryUnequip(uid, slot.ID, true, true);
}
}
foreach (var held in _hands.EnumerateHeld(uid))
{
_hands.TryDrop(uid, held);
}
}
// WD edit end
}
}