From 6f43a5d983b90069f5232f36dfabd77f506d887f Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 27 Jan 2023 12:13:49 +1100 Subject: [PATCH] Fix mapgrid rendering (#13642) --- Content.Client/Shuttles/UI/RadarControl.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Content.Client/Shuttles/UI/RadarControl.cs b/Content.Client/Shuttles/UI/RadarControl.cs index c7e373303d..a7e8ad970d 100644 --- a/Content.Client/Shuttles/UI/RadarControl.cs +++ b/Content.Client/Shuttles/UI/RadarControl.cs @@ -200,7 +200,7 @@ public sealed class RadarControl : Control foreach (var grid in _mapManager.FindGridsIntersecting(mapPosition.MapId, new Box2(mapPosition.Position - MaxRadarRange, mapPosition.Position + MaxRadarRange))) { - if (grid.Owner == ourGridId) + if (grid.Owner == ourGridId || !fixturesQuery.TryGetComponent(grid.Owner, out var gridFixtures)) continue; var gridBody = bodyQuery.GetComponent(grid.Owner); @@ -226,7 +226,6 @@ public sealed class RadarControl : Control name = Loc.GetString("shuttle-console-unknown"); var gridXform = xformQuery.GetComponent(grid.Owner); - var gridFixtures = fixturesQuery.GetComponent(grid.Owner); var gridMatrix = gridXform.WorldMatrix; Matrix3.Multiply(in gridMatrix, in offsetMatrix, out var matty); var color = iff?.Color ?? IFFComponent.IFFColor; @@ -350,7 +349,7 @@ public sealed class RadarControl : Control private void DrawGrid(DrawingHandleScreen handle, Matrix3 matrix, FixturesComponent component, Color color) { - foreach (var (_, fixture) in component.Fixtures) + foreach (var fixture in component.Fixtures.Values) { // If the fixture has any points out of range we won't draw any of it. var invalid = false;