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

@@ -489,7 +489,7 @@ namespace Content.Server.Inventory.Components
/// The underlying Container System just notified us that an entity was removed from it.
/// We need to make sure we process that removed entity as being unequipped from the slot.
/// </summary>
private void ForceUnequip(IContainer container, IEntity entity)
public void ForceUnequip(IContainer container, IEntity entity)
{
// make sure this is one of our containers.
// Technically the correct way would be to enumerate the possible slot names
@@ -572,23 +572,6 @@ namespace Content.Server.Inventory.Components
}
}
/// <inheritdoc />
public override void HandleMessage(ComponentMessage message, IComponent? component)
{
base.HandleMessage(message, component);
switch (message)
{
case ContainerContentsModifiedMessage msg:
if (msg.Removed)
ForceUnequip(msg.Container, msg.Entity);
break;
default:
break;
}
}
/// <inheritdoc />
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel,
ICommonSession? session = null)