From: Christopher Thirtle <29220292+ChrisThirtle@users.noreply.github.com> Date: Mon, 6 Nov 2023 02:40:25 +0000 (-0600) Subject: Use object-spaced bounding boxes for putting stuff in crates (#21427) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=d07ea20f74bedc584cef22f1bad1a9f50b80baf1;p=space-station-14.git 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 --- 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); }