Grantapher / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
GNU Affero General Public License v3.0
210 stars 23 forks source link

[BUG] Failed to apply patches #86

Closed junzhugithub closed 1 month ago

junzhugithub commented 1 month ago

Describe the bug

[Info :Valheim Plus] Configuration file loaded successfully. [Info :Valheim Plus] Applying patches. [Error :Valheim Plus] Failed to apply patches. [Warning:Valheim Plus] Valheim Plus failed to apply patches. Please ensure the game version (0.218.16) is compatible with the Valheim Plus version (0.9.14.0-alpha02) at https://github.com/Grantapher/ValheimPlus/blob/grantapher-development/COMPATIBILITY.md. If it already is, please report a bug at https://github.com/Grantapher/ValheimPlus/issues. [Error : Unity Log] InvalidProgramException: Invalid IL code in (wrapper dynamic-method) Player:DMD (Player,bool): IL_04a4: call 0x000000f9

Stack trace: System.RuntimeMethodHandle.GetFunctionPointer () (at <17d9ce77f27a4bd2afb5ba32c9bea976>:0) MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) (at <4e2760c7517c4ea79c633d67e84b319f>:0) MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0) MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0) MonoMod.RuntimeDetour.Detour._RefreshChain (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:0) MonoMod.RuntimeDetour.Detour.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0) MonoMod.RuntimeDetour.Detour..ctor (System.Reflection.MethodBase from, System.Reflection.MethodBase to, MonoMod.RuntimeDetour.DetourConfig& config) (at <4e2760c7517c4ea79c633d67e84b319f>:0) (wrapper dynamic-method) MonoMod.RuntimeDetour.ILHook+Context.DMD<MonoMod.RuntimeDetour.ILHook+Context::Refresh>(MonoMod.RuntimeDetour.ILHook/Context) (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition.Trampoline<MonoMod.RuntimeDetour.ILHook+Context::Refresh>?1913053100(object) HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) MonoMod.RuntimeDetour.ILHook.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:0) HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) Rethrow as HarmonyException: IL Compile Error (unknown location) HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) Rethrow as HarmonyException: IL Compile Error (unknown location) HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Harmony.b__11_0 (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable1[T] sequence, System.Action1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Harmony.PatchAll () (at <474744d65d8e460fa08cd5fd82b5d65f>:0) ValheimPlus.ValheimPlusPlugin.PatchAll () (at :0) ValheimPlus.ValheimPlusPlugin.Awake () (at :0) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.GameObject:.cctor() PlatformTools.Common.SingletonMonoBehaviour`1:get_Instance() PlatformTools.PlatformManagerInitializer:OnRuntimeMethodLoad()

To Reproduce I downloaded the version 0.9.14.0-alpha02 ValheimPlus.dll from Github and put it in "\Thunderstore Mod Manager\DataFolder\Valheim\profiles\Default\BepInEx\plugins\Grantapher-ValheimPlus_Grantapher_Temporary" Oppened the game from thounderstore with modded button.

Expected behavior

It seems V+ mod didn't patch in as it said, won't work in game. not sure if it's a bug or a problem from my end.

Grantapher commented 1 month ago

Can't reproduce. Is this Steam version on Windows? Any other mods used?

It may be easier to go to the discord and open a troubleshooting post.

junzhugithub commented 1 month ago

Steam and tons of mods... Thank you, I'll try reinstall the game, it seems easier.

junzhugithub commented 1 month ago

Report: problem solved. Checked the game integrity and delleted all mods/reinstalled. worked like a charm as always.