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:
Acruid
2019-09-01 17:08:15 -07:00
parent 7a55c07e22
commit 5aafe89d95

View File

@@ -22,6 +22,8 @@ namespace Content.Server.GameObjects.Components
{ {
public override string Name => "EntityStorage"; 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 int StorageCapacityMax;
private bool IsCollidableWhenOpen; private bool IsCollidableWhenOpen;
private Container Contents; private Container Contents;
@@ -116,8 +118,8 @@ namespace Content.Server.GameObjects.Components
var collidableComponent = Owner.GetComponent<ICollidableComponent>(); var collidableComponent = Owner.GetComponent<ICollidableComponent>();
if(entity.TryGetComponent<ICollidableComponent>(out var entityCollidableComponent)) if(entity.TryGetComponent<ICollidableComponent>(out var entityCollidableComponent))
{ {
if(collidableComponent.WorldAABB.Size.X < entityCollidableComponent.WorldAABB.Size.X if(MaxSize < entityCollidableComponent.WorldAABB.Size.X
|| collidableComponent.WorldAABB.Size.Y < entityCollidableComponent.WorldAABB.Size.Y) || MaxSize < entityCollidableComponent.WorldAABB.Size.Y)
{ {
return false; return false;
} }