Henit3 / DramaMask

Enables masks to be worn to hide from enemies by blending in with the Masked and adds a safe mask, Drama!
https://thunderstore.io/c/lethal-company/p/necrowing/DramaMask/
MIT License
0 stars 0 forks source link

[Bug] Drama mask bootup issue in v65 #8

Open ajsglist opened 4 hours ago

ajsglist commented 4 hours ago

Hey there,

I went to check out the new patch with my mod pack, and it seems that DramaMask is throwing an error and may not be working on the newest patch (or in conjunction with some other mod that has updated recently/for v65)

[21:11:22.1857106] [Info   :   BepInEx] Loading [DiscountAlert 2.3.0.0]
[21:11:22.2337219] [Info   :DiscountAlert] Plugin discount.alert is loaded!
[21:11:22.2447242] [Info   :   BepInEx] Loading [Stealthy Masks 2.1.3]
[21:11:22.2537266] [Info   :Stealthy Masks] Plugin DramaMask (2.1.3) is loading...
[21:11:22.4267648] [Info   :Stealthy Masks] Registered enemy [HoarderBugAI] to not be hidden from
[21:11:22.4277653] [Info   :Stealthy Masks] Registered enemy [ForestGiantAI] to be hidden from
[21:11:22.4507703] [Info   :Stealthy Masks] Loading assets...
[21:11:22.5227866] [Info   :Stealthy Masks] Loading assets complete!
[21:11:22.5227866] [Info   :Stealthy Masks] Patching...
[21:11:22.5787992] [Error  : Unity Log] InvalidProgramException: Invalid IL code in (wrapper dynamic-method) GameNetcodeStuff.PlayerControllerB:DMD<GameNetcodeStuff.PlayerControllerB::DropAllHeldItems> (GameNetcodeStuff.PlayerControllerB,bool,bool): IL_028d: ret

Stack trace:
System.RuntimeMethodHandle.GetFunctionPointer () (at <787acc3c9a4c471ba7d971300105af24>:IL_0000)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetFunctionPointer (System.Reflection.MethodBase method, System.RuntimeMethodHandle handle) (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0000)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:IL_004D)
MonoMod.RuntimeDetour.DetourHelper.GetNativeStart (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0005)
MonoMod.RuntimeDetour.Detour._TopApply () (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0025)
MonoMod.RuntimeDetour.Detour._RefreshChain (System.Reflection.MethodBase method) (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0149)
MonoMod.RuntimeDetour.Detour.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0053)
MonoMod.RuntimeDetour.Detour..ctor (System.Reflection.MethodBase from, System.Reflection.MethodBase to, MonoMod.RuntimeDetour.DetourConfig& config) (at <4e2760c7517c4ea79c633d67e84b319f>:IL_02E1)
(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>?574978926(object)
HarmonyLib.Internal.RuntimeFixes.StackTraceFixes.OnILChainRefresh (System.Object self) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0000)
MonoMod.RuntimeDetour.ILHook.Apply () (at <4e2760c7517c4ea79c633d67e84b319f>:IL_0059)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0047)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.Public.Patching.ManagedMethodPatcher.DetourTo (System.Reflection.MethodBase replacement) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_005F)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0033)
Rethrow as HarmonyException: IL Compile Error (unknown location)
HarmonyLib.PatchClassProcessor.ReportException (System.Exception exception, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0045)
HarmonyLib.PatchClassProcessor.Patch () (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0095)
HarmonyLib.Harmony.PatchAll (System.Type type) (at <474744d65d8e460fa08cd5fd82b5d65f>:IL_0008)
DramaMask.Extensions.HarmonyExtensions.PatchExcept (HarmonyLib.Harmony harmony, System.Type[] exceptions) (at C:/Users/Henit/Desktop/My Files/Side-Code/LethalMods/DramaMask/src/Extensions/HarmonyExtensions.cs:15)
DramaMask.Plugin.Awake () (at C:/Users/Henit/Desktop/My Files/Side-Code/LethalMods/DramaMask/src/Plugin.cs:46)
UnityEngine.GameObject:AddComponent(Type)
BepInEx.Bootstrap.Chainloader:Start()
UnityEngine.Rendering.HighDefinition.HDRenderPipelineAsset:OnEnable()

[21:11:22.5797996] [Info   :   BepInEx] Loading [Solid's Library 1.2.1]

Happy to provide anything else you might need, just let me know.

Cheers

Henit3 commented 3 hours ago

Hey, I can't replicate this for the mod on its own in v65 so it's likely there is a compatibility issue. Could you send over your profile code so I can take a look?

ajsglist commented 2 hours ago

Of course!

0192bb75-3e11-0835-bc09-0d9867163c2a

Make sure to turn DramaMask back on (it's disabled in that code), but otherwise that should be the same set of mods as when I reported the issue. It's worth noting that there is another issue being thrown at bootup from OBC not recognizing the MoreCompany update. Which probably has nothing to do with DramaMask, just noting it for completeness

Henit3 commented 2 hours ago

Just updating that Late Game Upgrades is the culprit here, with both mods transpiling this method: https://github.com/Malcolm-Q/LC-LateGameUpgrades/blob/f146d9595a4f89396baef7d9e609adedc2745785/MoreShipUpgrades/Patches/PlayerController/PlayerControllerBPatcher.cs#L376

I'll take a look later to see if I can add back compatibility

ajsglist commented 1 hour ago

Thanks for the update. If you'd prefer I open a ticket on LGU's side just let me know. Otherwise I'll leave this open for the moment.

Thanks again