Remove manual container ejection checking code.
This fixes map load when something is in a storage component.
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Shared.Input;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.GameObjects.Components.Container;
|
||||
using Robust.Server.GameObjects.EntitySystemMessages;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Input;
|
||||
@@ -91,22 +92,6 @@ namespace Content.Server.GameObjects
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void RemoveHandEntity(IEntity entity)
|
||||
{
|
||||
if (entity == null)
|
||||
return;
|
||||
|
||||
foreach (var slot in hands.Values)
|
||||
{
|
||||
if (slot.ContainedEntity == entity)
|
||||
{
|
||||
slot.Remove(entity);
|
||||
}
|
||||
}
|
||||
Dirty();
|
||||
}
|
||||
|
||||
public ItemComponent GetHand(string index)
|
||||
{
|
||||
var slot = hands[index];
|
||||
@@ -504,5 +489,26 @@ namespace Content.Server.GameObjects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void HandleSlotModifiedMaybe(ContainerModifiedMessage message)
|
||||
{
|
||||
foreach (var container in hands.Values)
|
||||
{
|
||||
if (container != message.Container)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Dirty();
|
||||
if (!message.Entity.TryGetComponent(out PhysicsComponent physics))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// set velocity to zero
|
||||
physics.LinearVelocity = Vector2.Zero;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user