Removes all dependencies on engine component events. (#4199)

This commit is contained in:
Acruid
2021-06-18 01:49:18 -07:00
committed by GitHub
parent 9fea68707c
commit e1e54e9cb1
27 changed files with 235 additions and 184 deletions

View File

@@ -0,0 +1,27 @@
using Content.Server.Inventory.Components;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
namespace Content.Server.Inventory
{
class InventorySystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<HumanInventoryControllerComponent, EntRemovedFromContainerMessage>(HandleRemovedFromContainer);
SubscribeLocalEvent<InventoryComponent, EntRemovedFromContainerMessage>(HandleInvRemovedFromContainer);
}
private static void HandleInvRemovedFromContainer(EntityUid uid, InventoryComponent component, EntRemovedFromContainerMessage args)
{
component.ForceUnequip(args.Container, args.Entity);
}
private static void HandleRemovedFromContainer(EntityUid uid, HumanInventoryControllerComponent component, EntRemovedFromContainerMessage args)
{
component.CheckUniformExists();
}
}
}