diff --git a/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs b/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs index ef6283b6ff..784c39a6ce 100644 --- a/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs +++ b/Content.Client/Radiation/Overlays/RadiationDebugOverlay.cs @@ -11,6 +11,7 @@ namespace Content.Client.Radiation.Overlays; public sealed class RadiationDebugOverlay : Overlay { [Dependency] private readonly IEntityManager _entityManager = default!; + private readonly SharedMapSystem _mapSystem; private readonly RadiationSystem _radiation; private readonly Font _font; @@ -21,6 +22,7 @@ public sealed class RadiationDebugOverlay : Overlay { IoCManager.InjectDependencies(this); _radiation = _entityManager.System(); + _mapSystem = _entityManager.System(); var cache = IoCManager.Resolve(); _font = new VectorFont(cache.GetResource("/Fonts/NotoSans/NotoSans-Regular.ttf"), 8); @@ -67,7 +69,7 @@ public sealed class RadiationDebugOverlay : Overlay foreach (var (tile, rads) in blockers) { - var worldPos = grid.GridTileToWorldPos(tile); + var worldPos = _mapSystem.GridTileToWorldPos(gridUid, grid, tile); var screenCenter = args.ViewportControl.WorldToScreen(worldPos); handle.DrawString(_font, screenCenter, rads.ToString("F2"), 1.5f, Color.White); } @@ -95,8 +97,8 @@ public sealed class RadiationDebugOverlay : Overlay var offset = new Vector2(grid.TileSize, -grid.TileSize) * 0.25f; foreach (var (tile, value) in resMap) { - var localPos = grid.GridTileToLocal(tile).Position + offset; - var worldPos = grid.LocalToWorld(localPos); + var localPos = _mapSystem.GridTileToLocal(gridUid, grid, tile).Position + offset; + var worldPos = _mapSystem.LocalToWorld(gridUid, grid, localPos); var screenCenter = args.ViewportControl.WorldToScreen(worldPos); handle.DrawString(_font, screenCenter, value.ToString("F2"), color: Color.White); } @@ -129,7 +131,7 @@ public sealed class RadiationDebugOverlay : Overlay if (!_entityManager.TryGetComponent(gridUid, out var grid)) continue; var (destTile, _) = blockers.Last(); - var destWorld = grid.GridTileToWorldPos(destTile); + var destWorld = _mapSystem.GridTileToWorldPos(gridUid, grid, destTile); handle.DrawLine(ray.Source, destWorld, Color.Red); } }