Allow t-ray to penetrate carpets and puddles (#25276)
* Allow t-ray to penetrate carpets and puddles * handle edge cases
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.DrawDepth;
|
||||
using Content.Shared.SubFloor;
|
||||
using Robust.Client.GameObjects;
|
||||
|
||||
@@ -62,6 +63,18 @@ public sealed class SubFloorHideSystem : SharedSubFloorHideSystem
|
||||
}
|
||||
|
||||
args.Sprite.Visible = hasVisibleLayer || revealed;
|
||||
|
||||
// allows a t-ray to show wires/pipes above carpets/puddles
|
||||
if (scannerRevealed)
|
||||
{
|
||||
component.OriginalDrawDepth ??= args.Sprite.DrawDepth;
|
||||
args.Sprite.DrawDepth = (int) Shared.DrawDepth.DrawDepth.FloorObjects + 1;
|
||||
}
|
||||
else if (component.OriginalDrawDepth.HasValue)
|
||||
{
|
||||
args.Sprite.DrawDepth = component.OriginalDrawDepth.Value;
|
||||
component.OriginalDrawDepth = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateAll()
|
||||
|
||||
Reference in New Issue
Block a user