From 0c4e2650dd0b5b75e419e2f987f3450359c3dad5 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 24 Nov 2023 00:35:49 +1100 Subject: [PATCH] Minor decal change (#21860) --- Content.Client/Decals/Overlays/DecalOverlay.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Content.Client/Decals/Overlays/DecalOverlay.cs b/Content.Client/Decals/Overlays/DecalOverlay.cs index f2c11e2a68..6fcd48264b 100644 --- a/Content.Client/Decals/Overlays/DecalOverlay.cs +++ b/Content.Client/Decals/Overlays/DecalOverlay.cs @@ -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(); var xformSystem = _entManager.System(); var eyeAngle = args.Viewport.Eye?.Rotation ?? Angle.Zero; - foreach (var (decalGrid, xform) in _entManager.EntityQuery(true)) + var gridQuery = _entManager.AllEntityQueryEnumerator(); + + 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); -- 2.51.2