karkkant / valheim-solid_hitboxes

MIT License
0 stars 1 forks source link

Incompatible with Ashlands update #5

Open nbusseneau opened 5 months ago

nbusseneau commented 5 months ago

Hey, thanks for your mods.

Seems like the Ashlands update broke the Harmony patches.

[Info   :   BepInEx] Loading [Solid Hitboxes 1.0.5]
[Info   : Unity Log] Patch failed.
[Error  : Unity Log] InvalidProgramException: Invalid IL code in (wrapper dynamic-method) Projectile:DMD<Projectile::OnHit> (Projectile,UnityEngine.Collider,UnityEngine.Vector3,bool,UnityEngine.Vector3): IL_028d: callvirt  0x00000087

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._TopApply () (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>?55061666(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.<PatchAll>b__11_0 (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.CollectionExtensions.Do[T] (System.Collections.Generic.IEnumerable`1[T] sequence, System.Action`1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
HarmonyLib.Harmony.PatchAll () (at <474744d65d8e460fa08cd5fd82b5d65f>:0)
SolidHitboxes.Plugin.Awake () (at <818658ca8ab3449c96c64fc7c15859af>:0)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.GameObject:.cctor()
PlatformTools.Common.SingletonMonoBehaviour`1:get_Instance()
PlatformTools.PlatformManagerInitializer:OnRuntimeMethodLoad()
karkkant commented 5 months ago

Sorry for delayed reply. I still haven't been able to test Ashlands so fixing this may take some time.

I took a quick look at the code though and there has been some interesting changes. There's a new "hitFriendly"-flag for melee attacks that may be toggled on for some creatures in vanilla settings. Also not 100% tested but ranged attacks may also collide now with friendlies. Hopefully there's now easier way to make this work and in best case this mod is soon obsolete. 😄

AvaBecker commented 1 week ago

Hello Karkkant! I recently discovered your interesting mods, and I had a question about SolidHitboxes:

Was it ever supposed to work with enemy melee attacks, damaging other enemies? Or just projectiles and other things?

I'm unsure if it's currently just broken, or if that was the intended functionality all along (can't seem to find a video of someone using it to confirm), and I'm not confident in my lackluster coding ability to be able to verify, haha.

karkkant commented 1 week ago

It's currently broken.

It used to work for both melee and ranged attacks on all enemies. I had a longer break from the game but maybe I'll look into fixing it when I get the time.