Reduce shuttle smimsh allocations (#22952)

(cherry picked from commit 3a166e14230650f7d0dc40c370898d02b3206a83)
This commit is contained in:
metalgearsloth 2023-12-31 03:12:52 +11:00 committed by Debug
parent 371fafddbd
commit dfb8cb1740
No known key found for this signature in database
GPG Key ID: 271270A74EF9C350
1 changed files with 5 additions and 1 deletions

View File

@ -77,6 +77,8 @@ public sealed partial class ShuttleSystem
/// </summary>
public const float FTLDestinationMass = 500f;
private HashSet<EntityUid> _lookupEnts = new();
private EntityQuery<BodyComponent> _bodyQuery;
private EntityQuery<BuckleComponent> _buckleQuery;
private EntityQuery<GhostComponent> _ghostQuery;
@ -716,8 +718,10 @@ public sealed partial class ShuttleSystem
// Handle clearing biome stuff as relevant.
tileSet.Clear();
_biomes.ReserveTiles(xform.MapUid.Value, aabb, tileSet);
_lookupEnts.Clear();
_lookup.GetEntitiesIntersecting(xform.MapUid.Value, aabb, _lookupEnts, LookupFlags.Uncontained);
foreach (var ent in _lookup.GetEntitiesIntersecting(xform.MapUid.Value, aabb, LookupFlags.Uncontained))
foreach (var ent in _lookupEnts)
{
if (ent == uid || immune.Contains(ent))
{