From d07ea20f74bedc584cef22f1bad1a9f50b80baf1 Mon Sep 17 00:00:00 2001 From: Christopher Thirtle <29220292+ChrisThirtle@users.noreply.github.com> Date: Sun, 5 Nov 2023 20:40:25 -0600 Subject: [PATCH] Use object-spaced bounding boxes for putting stuff in crates (#21427) * Use object-spaced bounding boxes for putting stuff in crates * Use existing _lookup.GetAABB, different component * PR edits updated * Remove unused bits from around GetAABB * Use GetAABBNoContainer --- .../Storage/EntitySystems/SharedEntityStorageSystem.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs index 2d85f79e03..31803c394f 100644 --- a/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs +++ b/Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs @@ -368,13 +368,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem if (toAdd == container) return false; - if (TryComp(toAdd, out var phys)) - { - var aabb = _physics.GetWorldAABB(toAdd, body: phys); - - if (component.MaxSize < aabb.Size.X || component.MaxSize < aabb.Size.Y) - return false; - } + var aabb = _lookup.GetAABBNoContainer(toAdd, Vector2.Zero, 0); + if (component.MaxSize < aabb.Size.X || component.MaxSize < aabb.Size.Y) + return false; return Insert(toAdd, container, component); }