Skip to content

Commit

Permalink
escape original rumble methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibodan committed Dec 8, 2018
1 parent 439a8e7 commit 87304c6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 15 additions & 3 deletions RumbleEnhancerOculus/HarmonyPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ static void Prefix(XRNode node)
PersistentSingleton<MyHapticFeedbackController>.instance.ContinuousRumble(node, Plugin.ObstacleClip);
}
}
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
return new List<CodeInstruction>() { new CodeInstruction(OpCodes.Ret) };
}
}

[HarmonyPatch(typeof(HapticFeedbackController))]
[HarmonyPatch("Rumble")]
public static class HapticFeedbackControllerRumblePatch
{
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
return new List<CodeInstruction>() { new CodeInstruction(OpCodes.Ret) };
}
}

[HarmonyPatch(typeof(OculusVRHelper))]
Expand All @@ -72,9 +86,7 @@ static void Prefix(XRNode node, float strength)
}
static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var codes = new List<CodeInstruction>(instructions);
codes[0].opcode = OpCodes.Ret;
return codes.AsEnumerable();
return new List<CodeInstruction>() { new CodeInstruction(OpCodes.Ret) };
}
}
}
2 changes: 1 addition & 1 deletion RumbleEnhancerOculus/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class Plugin : IPlugin
public static float CutRumbleDuration;

public string Name => "RumbleEnhancerOculus";
public string Version => "1.0.0";
public string Version => "1.0.2";

private OVRHapticsClip createHapticsClip(string strPattern)
{
Expand Down

0 comments on commit 87304c6

Please sign in to comment.