Skip to content

Commit

Permalink
Updated to Harmony 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Mar 17, 2017
1 parent ebb8dbb commit f0cfe44
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Binary file modified Assemblies/0Harmony.dll
Binary file not shown.
Binary file modified Assemblies/SameSpot.dll
Binary file not shown.
Binary file modified Harmony/0Harmony.dll
Binary file not shown.
25 changes: 13 additions & 12 deletions Source/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System;
using System.Reflection;
using UnityEngine;
using Harmony.ILCopying;
using System.Collections.Generic;

namespace SameSpot
{
Expand Down Expand Up @@ -41,18 +41,19 @@ static MethodBase TargetMethod()
return predicateClass.GetMethods(AccessTools.all).FirstOrDefault(m => m.ReturnType == typeof(bool));
}

static HarmonyProcessor ProcessorFactory(MethodBase original)
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var processor = new HarmonyProcessor();
processor.Add(new MethodReplacer(
AccessTools.Method(typeof(PawnDestinationManager), "DestinationIsReserved", new Type[] { typeof(IntVec3), typeof(Pawn) }),
AccessTools.Method(typeof(BestOrderedGotoDestNearPatcher), "DestinationIsReserved")
));
processor.Add(new MethodReplacer(
AccessTools.Method(typeof(GenGrid), "Standable"),
AccessTools.Method(typeof(BestOrderedGotoDestNearPatcher), "Standable")
));
return processor;
return instructions

.MethodReplacer(
AccessTools.Method(typeof(PawnDestinationManager), "DestinationIsReserved", new Type[] { typeof(IntVec3), typeof(Pawn) }),
AccessTools.Method(typeof(BestOrderedGotoDestNearPatcher), "DestinationIsReserved")
)

.MethodReplacer(
AccessTools.Method(typeof(GenGrid), "Standable"),
AccessTools.Method(typeof(BestOrderedGotoDestNearPatcher), "Standable")
);
}
}
}

0 comments on commit f0cfe44

Please sign in to comment.