valheimPlus / ValheimPlus

A HarmonyX Mod aimed at improving the gameplay and quality of life of the game Valheim.
http://valheim.plus
GNU Affero General Public License v3.0
967 stars 236 forks source link

[BUG][BETA] UpdateGroundContact has changed #718

Closed increddibelly closed 1 year ago

increddibelly commented 1 year ago

Describe the bug

looks like some methods were renamed or changed? I'll have another look with a debugger attached.

11/22/2022 17:07:19: Unable to transpile Character::UpdateGroundContact to patch fall damage calculation

[Warning:  HarmonyX] AccessTools.DeclaredMethod: Could not find method for type SEMan and name AddStatusEffect and parameters (StatusEffect, bool)
ArgumentException: Undefined target method for patch method static void ValheimPlus.GameClasses.SEMan_AddStatusEffect_Patch::Postfix(SEMan& __instance, StatusEffect& statusEffect, bool resetTime)
  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 HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) [0x0006c] in <474744d65d8e460fa08cd5fd82b5d65f>:0
  at HarmonyLib.PatchClassProcessor.Patch () [0x00095] in <474744d65d8e460fa08cd5fd82b5d65f>:0
  at HarmonyLib.Harmony.<PatchAll>b__11_0 (System.Type type) [0x00007] in <474744d65d8e460fa08cd5fd82b5d65f>:0
  at HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) [0x00014] in <474744d65d8e460fa08cd5fd82b5d65f>:0
  at HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) [0x00006] in <474744d65d8e460fa08cd5fd82b5d65f>:0

  at HarmonyLib.Harmony.PatchAll () [0x0001b] in <474744d65d8e460fa08cd5fd82b5d65f>:0
  at ValheimPlus.ValheimPlusPlugin.Awake () [0x00048] in <5a95645ebf264670b7e210ece81a6e52>:0
UnityEngine.GameObject:Internal_AddComponentWithType(Type)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()

A clear and concise description of what the bug is and how you found it.

To Reproduce

Steps for the devs to reproduce the behavior:

config for "fall" :

; This value represents how much the fall damage should be scaled in +/- %. This is a modifier value. ; The value 50 would result in 50% increased fall damage. The value -50 would result in 50% reduced fall damage. fallDamageScalePercent = -75

; Max fall damage. Game default is 100 (so with enough health, falls can't kill). maxFallDamage = 50

boot 0.212.5 server with latest v+ server files. => exception comes up

Expected behavior

A clear and concise description of what you expected to happen. maxfall damage overruled.

Troubleshooting

What steps have you taken to try to fix? none. I'll find the time to attach a debugger.

Screenshots

If applicable, add screenshots to help explain your problem.

Link to pastebin containing .cfg configuration if applicable:

Additional context

Please list any other mods besides V+ that you have installed here. Add any other context about the problem here.

nxPublic commented 1 year ago

#https://github.com/valheimPlus/ValheimPlus/commit/511f19718a1c882bcb3793fef54c8b5e68718874