From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 18 May 2023 09:27:59 +0000 (+1000) Subject: Fix decal sorting ignoring colors (#16553) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=37ca1fe9fe596bdcda65317d9bd5127c88b7f8c7;p=space-station-14.git Fix decal sorting ignoring colors (#16553) --- diff --git a/Content.Shared/Decals/DecalGridChunkCollectionTypeSerializer.cs b/Content.Shared/Decals/DecalGridChunkCollectionTypeSerializer.cs index bd48a93e92..fe27df0866 100644 --- a/Content.Shared/Decals/DecalGridChunkCollectionTypeSerializer.cs +++ b/Content.Shared/Decals/DecalGridChunkCollectionTypeSerializer.cs @@ -133,7 +133,6 @@ namespace Content.Shared.Decals } } - var lookupIndex = 0; var lookupNodes = lookup.Keys.ToList(); lookupNodes.Sort(); @@ -223,6 +222,16 @@ namespace Content.Shared.Decals if (idComparison != 0) return idComparison; + var colorComparison = string.Compare(Color?.ToHex(), other.Color?.ToHex(), StringComparison.Ordinal); + + if (colorComparison != 0) + return colorComparison; + + var angleComparison = Angle.Theta.CompareTo(other.Angle.Theta); + + if (angleComparison != 0) + return angleComparison; + var zIndexComparison = ZIndex.CompareTo(other.ZIndex); if (zIndexComparison != 0) return zIndexComparison;