diff --git a/Content.Client/SubFloor/SubFloorHideSystem.cs b/Content.Client/SubFloor/SubFloorHideSystem.cs index 997d375fbe..d545461c37 100644 --- a/Content.Client/SubFloor/SubFloorHideSystem.cs +++ b/Content.Client/SubFloor/SubFloorHideSystem.cs @@ -9,6 +9,7 @@ namespace Content.Client.SubFloor; public sealed class SubFloorHideSystem : SharedSubFloorHideSystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SpriteSystem _sprite = default!; [Dependency] private readonly IUserInterfaceManager _ui = default!; private bool _showAll; @@ -75,7 +76,7 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem var hasVisibleLayer = false; foreach (var layerKey in component.VisibleLayers) { - if (!args.Sprite.LayerMapTryGet(layerKey, out var layerIndex)) + if (!_sprite.LayerMapTryGet((uid, args.Sprite), layerKey, out var layerIndex, false)) continue; var layer = args.Sprite[layerIndex]; @@ -84,13 +85,13 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem hasVisibleLayer = true; } - args.Sprite.Visible = hasVisibleLayer || revealed; + _sprite.SetVisible((uid, args.Sprite), hasVisibleLayer || revealed); if (ShowAll) { // Allows sandbox mode to make wires visible over other stuff. component.OriginalDrawDepth ??= args.Sprite.DrawDepth; - args.Sprite.DrawDepth = (int)Shared.DrawDepth.DrawDepth.Overdoors; + _sprite.SetDrawDepth((uid, args.Sprite), (int)Shared.DrawDepth.DrawDepth.Overdoors); } else if (scannerRevealed) { @@ -99,11 +100,11 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem return; component.OriginalDrawDepth = args.Sprite.DrawDepth; var drawDepthDifference = Shared.DrawDepth.DrawDepth.ThickPipe - Shared.DrawDepth.DrawDepth.Puddles; - args.Sprite.DrawDepth -= drawDepthDifference - 1; + _sprite.SetDrawDepth((uid, args.Sprite), args.Sprite.DrawDepth - (drawDepthDifference - 1)); } else if (component.OriginalDrawDepth.HasValue) { - args.Sprite.DrawDepth = component.OriginalDrawDepth.Value; + _sprite.SetDrawDepth((uid, args.Sprite), component.OriginalDrawDepth.Value); component.OriginalDrawDepth = null; } }