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

[pbt-fix] Fix mute background music setting #47

Closed healiha closed 7 months ago

healiha commented 7 months ago

The way settings are managed have been revamped, making this part of the code throw an error as Settings.SaveSettings has been removed.

Related error:

[Warning:  HarmonyX] AccessTools.DeclaredMethod: Could not find method for type Settings and name SaveSettings and parameters 
[Error  :Valheim Plus] Failed to apply patches.
[Warning:Valheim Plus] This version of Valheim Plus (0.9.11.0) was compiled with a game version of "0.217.29", but this game version is newer at "0.217.36". If you are using the PTB, you likely need to use the non-beta version of the game. Otherwise, the errors seen above likely will require the Valheim Plus mod to be updated. If a game update just came out for Valheim, this may take some time for the mod to be updated. See https://github.com/Grantapher/ValheimPlus/blob/grantapher-development/COMPATIBILITY.md for what game versions are compatible with what mod versions.
ArgumentException: Undefined target method for patch method static void ValheimPlus.GameClasses.Settings_SaveSettings_Patch::Postfix()
  at HarmonyLib.PatchClassProcessor.PatchWithAttributes (System.Reflection.MethodBase& lastOriginal) [0x00047] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
  at HarmonyLib.PatchClassProcessor.Patch () [0x0006a] in <474744d65d8e460fa08cd5fd82b5d65f>:0 
Rethrow as HarmonyException: Patching exception in method null
  at ValheimPlus.ValheimPlusPlugin.PatchAll () [0x001bd] in <0c90af76a6194f2ea65dc8ddc90ec3db>:0 
  at ValheimPlus.ValheimPlusPlugin.Awake () [0x00061] in <0c90af76a6194f2ea65dc8ddc90ec3db>:0 
UnityEngine.GameObject:Internal_AddComponentWithType(GameObject, Type)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.GameObject:.cctor()
Fishlabs.Common.SingletonMonoBehaviour`1:get_Instance()
Fishlabs.PlatformManagerInitializer:OnRuntimeMethodLoad()