Made ordering multiple crates at cargo order multiple crates (#25518)

* please tell me this is empty

* it wasn't empty, fixing that

* This should fix it

* fix for the fix

* address changes

* fix

* Added some comments, hoping that failed test was a fluke.
This commit is contained in:
Flesh
2024-02-25 08:36:22 +01:00
committed by GitHub
parent 9a4c10cc89
commit aa4e7c0619
2 changed files with 17 additions and 9 deletions

View File

@@ -196,12 +196,14 @@ public sealed partial class CargoSystem
return _pads;
}
private IEnumerable<(EntityUid Entity, CargoPalletComponent Component, TransformComponent Transform)>
private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent Transform)>
GetFreeCargoPallets(EntityUid gridUid,
List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent Transform)> pallets)
{
_setEnts.Clear();
List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent Transform)> outList = new();
foreach (var pallet in pallets)
{
var aabb = _lookup.GetAABBNoContainer(pallet.Entity, pallet.Transform.LocalPosition, pallet.Transform.LocalRotation);
@@ -209,8 +211,10 @@ public sealed partial class CargoSystem
if (_lookup.AnyLocalEntitiesIntersecting(gridUid, aabb, LookupFlags.Dynamic))
continue;
yield return pallet;
outList.Add(pallet);
}
return outList;
}
#endregion