]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Small adjustment for elookup api (#22447)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 4 Jan 2024 04:13:19 +0000 (15:13 +1100)
committerGitHub <noreply@github.com>
Thu, 4 Jan 2024 04:13:19 +0000 (15:13 +1100)
* Small adjustment for elookup api

* fix

Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Hotspot.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs

index 989fed945f50d850810a0ab1cb1b5dd5506041ce..89a42b576bc8663409516c12aa3eb9d4ecd90a51 100644 (file)
@@ -140,7 +140,10 @@ namespace Content.Server.Atmos.EntitySystems
                     tile.PressureSpecificTarget = curTile;
             }
 
-            foreach (var entity in _lookup.GetEntitiesIntersecting(tile.GridIndex, tile.GridIndices, 0f))
+            _entSet.Clear();
+            _lookup.GetLocalEntitiesIntersecting(tile.GridIndex, tile.GridIndices, _entSet, 0f);
+
+            foreach (var entity in _entSet)
             {
                 // Ideally containers would have their own EntityQuery internally or something given recursively it may need to slam GetComp<T> anyway.
                 // Also, don't care about static bodies (but also due to collisionwakestate can't query dynamic directly atm).
index 5b3d869229cdc787d1baa46d74fc35e7f16c09b5..8966f232e06b4426b5e6270b0071f7daf442c3fe 100644 (file)
@@ -165,8 +165,10 @@ namespace Content.Server.Atmos.EntitySystems
             }
 
             var fireEvent = new TileFireEvent(tile.Hotspot.Temperature, tile.Hotspot.Volume);
+            _entSet.Clear();
+            _lookup.GetLocalEntitiesIntersecting(tile.GridIndex, tile.GridIndices, _entSet, 0f);
 
-            foreach (var entity in _lookup.GetEntitiesIntersecting(tile.GridIndex, tile.GridIndices, 0f))
+            foreach (var entity in _entSet)
             {
                 RaiseLocalEvent(entity, ref fireEvent);
             }
index 07efdb4f679c741230b1decb0f828adefd90e560..116ab1721130776e030ada9ed51b1866e0c51f77 100644 (file)
@@ -38,6 +38,8 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
     private const float ExposedUpdateDelay = 1f;
     private float _exposedTimer = 0f;
 
+    private HashSet<EntityUid> _entSet = new();
+
     public override void Initialize()
     {
         base.Initialize();