]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Minor decal change (#21860)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Thu, 23 Nov 2023 13:35:49 +0000 (00:35 +1100)
committerGitHub <noreply@github.com>
Thu, 23 Nov 2023 13:35:49 +0000 (00:35 +1100)
Content.Client/Decals/Overlays/DecalOverlay.cs

index f2c11e2a682ebfc896cb2ccd0114dedc35599d20..6fcd48264bad608a011d7cc85668dba7cfef87a3 100644 (file)
@@ -30,21 +30,22 @@ namespace Content.Client.Decals.Overlays
         {
             // Shouldn't need to clear cached textures unless the prototypes get reloaded.
             var handle = args.WorldHandle;
-            var xformQuery = _entManager.GetEntityQuery<TransformComponent>();
             var xformSystem = _entManager.System<TransformSystem>();
             var eyeAngle = args.Viewport.Eye?.Rotation ?? Angle.Zero;
 
-            foreach (var (decalGrid, xform) in _entManager.EntityQuery<DecalGridComponent, TransformComponent>(true))
+            var gridQuery = _entManager.AllEntityQueryEnumerator<DecalGridComponent, TransformComponent>();
+
+            while (gridQuery.MoveNext(out var decalGrid, out var xform))
             {
+                if (xform.MapID != args.MapId)
+                    continue;
+
                 var zIndexDictionary = decalGrid.DecalRenderIndex;
 
                 if (zIndexDictionary.Count == 0)
                     continue;
 
-                if (xform.MapID != args.MapId)
-                    continue;
-
-                var (_, worldRot, worldMatrix) = xformSystem.GetWorldPositionRotationMatrix(xform, xformQuery);
+                var (_, worldRot, worldMatrix) = xformSystem.GetWorldPositionRotationMatrix(xform);
 
                 handle.SetTransform(worldMatrix);