Skip to content

Commit

Permalink
Cleaning up some code
Browse files Browse the repository at this point in the history
  • Loading branch information
KiameV committed May 12, 2018
1 parent d48b8d5 commit aa19360
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Source/HarmonyPatches.cs
Expand Up @@ -232,16 +232,25 @@ public static void SwapApparel(Pawn pawn, Outfit toWear)
#if DEBUG
Log.Message("End Main.SwapApparel" + Environment.NewLine);
#endif
foreach (Apparel a in pawn.apparel.WornApparel)
{
Patch_Pawn_ApparelTracker_Notify_ApparelAdded.ColorApparel(pawn, a);
}
}
}

[HarmonyPatch(typeof(Pawn_ApparelTracker), "Notify_ApparelAdded")]
static class Patch_Pawn_ApparelTracker_Notify_ApparelAdded
{
static void Prefix(Pawn_ApparelTracker __instance, Apparel apparel)
{
ColorApparel(__instance.pawn, apparel);
}

internal static void ColorApparel(Pawn pawn, Apparel apparel)
{
PawnOutfits outfits;
if (WorldComp.PawnOutfits.TryGetValue(__instance.pawn, out outfits))
if (WorldComp.PawnOutfits.TryGetValue(pawn, out outfits))
{
outfits.ColorApparel(apparel);
}
Expand Down
Expand Up @@ -5,3 +5,4 @@ C:\Users\Travisty\Documents\Visual Studio 2017\Projects\RimWorld\ChangeDresser\S
C:\Users\Travisty\Documents\Visual Studio 2017\Projects\RimWorld\ChangeDresser\Source\obj\Release\ChangeDresser.csprojResolveAssemblyReference.cache
C:\Users\tofft\Documents\Visual Studio 2017\Projects\RimWorld\ChangeDresser\Source\obj\Release\ChangeDresser.csproj.CoreCompileInputs.cache
C:\Users\tofft\Documents\Visual Studio 2017\Projects\RimWorld\ChangeDresser\Source\obj\Release\ChangeDresser.dll
C:\Users\tofft\Documents\Visual Studio 2017\Projects\RimWorld\ChangeDresser\Source\obj\Release\ChangeDresser.csprojResolveAssemblyReference.cache

0 comments on commit aa19360

Please sign in to comment.