Reduce shuttle smimsh allocations (#22952)
This commit is contained in:
@@ -77,6 +77,8 @@ public sealed partial class ShuttleSystem
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public const float FTLDestinationMass = 500f;
|
public const float FTLDestinationMass = 500f;
|
||||||
|
|
||||||
|
private HashSet<EntityUid> _lookupEnts = new();
|
||||||
|
|
||||||
private EntityQuery<BodyComponent> _bodyQuery;
|
private EntityQuery<BodyComponent> _bodyQuery;
|
||||||
private EntityQuery<BuckleComponent> _buckleQuery;
|
private EntityQuery<BuckleComponent> _buckleQuery;
|
||||||
private EntityQuery<GhostComponent> _ghostQuery;
|
private EntityQuery<GhostComponent> _ghostQuery;
|
||||||
@@ -716,8 +718,10 @@ public sealed partial class ShuttleSystem
|
|||||||
// Handle clearing biome stuff as relevant.
|
// Handle clearing biome stuff as relevant.
|
||||||
tileSet.Clear();
|
tileSet.Clear();
|
||||||
_biomes.ReserveTiles(xform.MapUid.Value, aabb, tileSet);
|
_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))
|
if (ent == uid || immune.Contains(ent))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user