]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup warnings in `SubFloorHideSystem` (#37488)
authorTayrtahn <tayrtahn@gmail.com>
Thu, 15 May 2025 20:04:43 +0000 (16:04 -0400)
committerGitHub <noreply@github.com>
Thu, 15 May 2025 20:04:43 +0000 (22:04 +0200)
Cleanup warnings in SubFloorHideSystem

Content.Client/SubFloor/SubFloorHideSystem.cs

index 997d375fbee62a1dd636de8bd15ef6b6e52ee596..d545461c3755c23eb8febedae0fe40c1e19d40a5 100644 (file)
@@ -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;
         }
     }