Skip to content

Commit

Permalink
Merge branch 'pr/8'
Browse files Browse the repository at this point in the history
  • Loading branch information
jecrell committed Feb 27, 2020
2 parents 9c61e75 + 1b6a5ee commit cfeff61
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 7 additions & 5 deletions Source/AllModdingComponents/JecsTools/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,13 @@ public static void Post_CanWearTogether(ThingDef A, ThingDef B, BodyDef body, re
{
var aExt = A.GetModExtension<ApparelExtension>();
var bExt = B.GetModExtension<ApparelExtension>();
var check = new Dictionary<string, int>();
var check = new HashSet<string>();
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 +
Expand All @@ -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;
Expand Down
10 changes: 4 additions & 6 deletions Source/AllModdingComponents/JecsTools/PlaceWorker_Outline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IntVec3>();
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));
}

}
Expand Down

0 comments on commit cfeff61

Please sign in to comment.