Set the max size of a Storage to a constant, regardless of the physical size of the Storage. This lets lockers eat objects larger than themselves (like mobs). This resolves https://github.com/space-wizards/space-station-14/issues/294.
This commit is contained in:
@@ -22,6 +22,8 @@ namespace Content.Server.GameObjects.Components
|
||||
{
|
||||
public override string Name => "EntityStorage";
|
||||
|
||||
private const float MaxSize = 1.0f; // maximum width or height of an entity allowed inside the storage.
|
||||
|
||||
private int StorageCapacityMax;
|
||||
private bool IsCollidableWhenOpen;
|
||||
private Container Contents;
|
||||
@@ -116,8 +118,8 @@ namespace Content.Server.GameObjects.Components
|
||||
var collidableComponent = Owner.GetComponent<ICollidableComponent>();
|
||||
if(entity.TryGetComponent<ICollidableComponent>(out var entityCollidableComponent))
|
||||
{
|
||||
if(collidableComponent.WorldAABB.Size.X < entityCollidableComponent.WorldAABB.Size.X
|
||||
|| collidableComponent.WorldAABB.Size.Y < entityCollidableComponent.WorldAABB.Size.Y)
|
||||
if(MaxSize < entityCollidableComponent.WorldAABB.Size.X
|
||||
|| MaxSize < entityCollidableComponent.WorldAABB.Size.Y)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user