]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Use object-spaced bounding boxes for putting stuff in crates (#21427)
authorChristopher Thirtle <29220292+ChrisThirtle@users.noreply.github.com>
Mon, 6 Nov 2023 02:40:25 +0000 (20:40 -0600)
committerGitHub <noreply@github.com>
Mon, 6 Nov 2023 02:40:25 +0000 (21:40 -0500)
* 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

Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs

index 2d85f79e0388d9cc8548ad6356dbbaf2c18bac72..31803c394f24c36326379fc18eaef26d9b3aa54d 100644 (file)
@@ -368,13 +368,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem
         if (toAdd == container)
             return false;
 
-        if (TryComp<PhysicsComponent>(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);
     }