diff --git a/Source/AllModdingComponents/JecsTools/HarmonyPatches.cs b/Source/AllModdingComponents/JecsTools/HarmonyPatches.cs index ddcb35cb..9e2d95d4 100644 --- a/Source/AllModdingComponents/JecsTools/HarmonyPatches.cs +++ b/Source/AllModdingComponents/JecsTools/HarmonyPatches.cs @@ -377,12 +377,13 @@ public static void Post_CanWearTogether(ThingDef A, ThingDef B, BodyDef body, re { var aExt = A.GetModExtension(); var bExt = B.GetModExtension(); - var check = new Dictionary(); + var check = new HashSet(); if (aExt.coverage?.Count > 0) for (int i = 0; i < aExt.coverage.Count; i++) { - if (!check.ContainsKey(aExt.coverage[i])) - check.Add(aExt.coverage[i].ToLowerInvariant(), 1); + var coverageItem = aExt.coverage[i].ToLowerInvariant(); + if (!check.Contains(coverageItem)) + check.Add(coverageItem); else { Log.Warning("JecsTools :: ApparelExtension :: Warning:: " + A.label + @@ -394,8 +395,9 @@ public static void Post_CanWearTogether(ThingDef A, ThingDef B, BodyDef body, re if (bExt.coverage?.Count > 0) for (int j = 0; j < bExt.coverage.Count; j++) { - if (!check.ContainsKey(bExt.coverage[j])) - check.Add(bExt.coverage[j].ToLowerInvariant(), 1); + var coverageItem = bExt.coverage[j].ToLowerInvariant(); + if (!check.Contains(coverageItem)) + check.Add(coverageItem); else { __result = false; diff --git a/Source/AllModdingComponents/JecsTools/PlaceWorker_Outline.cs b/Source/AllModdingComponents/JecsTools/PlaceWorker_Outline.cs index c9ad069d..9b230fc2 100644 --- a/Source/AllModdingComponents/JecsTools/PlaceWorker_Outline.cs +++ b/Source/AllModdingComponents/JecsTools/PlaceWorker_Outline.cs @@ -6,16 +6,14 @@ namespace JecsTools { public class PlaceWorker_Outline : PlaceWorker { - public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol, Thing thing = null) + private static readonly Color transparentWhite = new Color(1f, 1f, 1f, 0f); + + public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol) { - // Changed by Tad : Missing Bool in Override, base provided. - // base.DrawGhost(def, center, rot, ghostCol, thing); var drawFieldCells = new List(); foreach (var c in GenAdj.CellsOccupiedBy(center, rot, def.size)) drawFieldCells.Add(c); - GenDraw.DrawFieldEdges(drawFieldCells); - drawFieldCells = null; - + GenDraw.DrawFieldEdges(drawFieldCells, Color.Lerp(ghostCol, transparentWhite, 0.5f)); } }