Skip to content

Commit

Permalink
Fixes for 0.154.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nxPublic committed Jun 9, 2021
1 parent ab2b081 commit 51c0a28
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ValheimPlus/GameClasses/Fermenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ private static bool Prefix(ref Fermenter __instance, ref string __result)
}
}

[HarmonyPatch(typeof(Fermenter), nameof(Fermenter.UpdateVis))]
public static class Fermenter_UpdateVis_Transpiler
// Update 0.154.1 refactored the name to SlowUpdate from UpdateVis
[HarmonyPatch(typeof(Fermenter), nameof(Fermenter.SlowUpdate))]
public static class Fermenter_SlowUpdate_Transpiler
{
private static MethodInfo method_GameObject_SetActive = AccessTools.Method(typeof(GameObject), nameof(GameObject.SetActive));
private static MethodInfo method_InvokeRPCTap = AccessTools.Method(typeof(Fermenter_UpdateVis_Transpiler), nameof(Fermenter_UpdateVis_Transpiler.InvokeRPCTap));
private static MethodInfo method_AddItemFromNearbyChests = AccessTools.Method(typeof(Fermenter_UpdateVis_Transpiler), nameof(Fermenter_UpdateVis_Transpiler.AddItemFromNearbyChests));
private static MethodInfo method_InvokeRPCTap = AccessTools.Method(typeof(Fermenter_SlowUpdate_Transpiler), nameof(Fermenter_SlowUpdate_Transpiler.InvokeRPCTap));
private static MethodInfo method_AddItemFromNearbyChests = AccessTools.Method(typeof(Fermenter_SlowUpdate_Transpiler), nameof(Fermenter_SlowUpdate_Transpiler.AddItemFromNearbyChests));

/// <summary>
/// Patches out the code that check for Fermenter status.
Expand Down Expand Up @@ -138,7 +139,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
}
if (!found)
{
ZLog.LogError("Failed to apply Fermenter_UpdateVis_Transpiler");
ZLog.LogError("Failed to apply Fermenter_UpdateVis_Transpiler 1");
return instructions;
}
found = false;
Expand All @@ -153,7 +154,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
}
}

ZLog.LogError("Failed to apply Fermenter_UpdateVis_Transpiler");
ZLog.LogError("Failed to apply Fermenter_UpdateVis_Transpiler 2");

return instructions;
}
Expand Down

0 comments on commit 51c0a28

Please sign in to comment.