Confirm with your password

Compatibility with ZenWorldSettings Done

Latest version throws up this error when using the two, likely to do with the AI Crew and Zen's Ship stopping code:

[Info : SailTrim] SailTrim: Ship.CustomFixedUpdate counts AI crew (2 sites) [Error : HarmonyX] Failed to patch virtual void Ship::CustomFixedUpdate(float fixedDeltaTime): System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Unable to match ship player count IL - Current state is invalid at HarmonyLib.CodeMatcher.ThrowIfInvalid (System.String explanation) [0x00021] in <474744d65d8e460fa08cd5fd82b5d65f>:0 at ZenWorldSettings.Sections.ShipRules.Ship_CustomFixedUpdate (System.Collections.Generic.IEnumerable1[T] codes) [0x00143] in <87f81cbdcf7740da8434c2288d264638>:0 at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&) at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <4449e9424e7e4d4d81a660907c68cb97>:0 --- End of inner exception stack trace --- at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00083] in <4449e9424e7e4d4d81a660907c68cb97>:0 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <4449e9424e7e4d4d81a660907c68cb97>:0 at HarmonyLib.Internal.Patching.ILManipulator.ApplyTranspilers (System.Reflection.Emit.ILGenerator il, System.Reflection.MethodBase original, System.Func2[T,TResult] getLocal, System.Func1[TResult] defineLabel) [0x00093] in <474744d65d8e460fa08cd5fd82b5d65f>:0 at HarmonyLib.Internal.Patching.ILManipulator.WriteTo (Mono.Cecil.Cil.MethodBody body, System.Reflection.MethodBase original) [0x00066] in <474744d65d8e460fa08cd5fd82b5d65f>:0 at HarmonyLib.Public.Patching.HarmonyManipulator.WriteTranspilers () [0x00084] in <474744d65d8e460fa08cd5fd82b5d65f>:0 at HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () [0x0002b] in <474744d65d8e460fa08cd5fd82b5d65f>:0 [Error : Unity Log] InvalidOperationException: Unable to match ship player count IL - Current state is invalid Stack trace: HarmonyLib.CodeMatcher.ThrowIfInvalid (System.String explanation) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) ZenWorldSettings.Sections.ShipRules.Ship_CustomFixedUpdate (System.Collections.Generic.IEnumerable1[T] codes) (at <87f81cbdcf7740da8434c2288d264638>:0) System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <4449e9424e7e4d4d81a660907c68cb97>:0) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <4449e9424e7e4d4d81a660907c68cb97>:0) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <4449e9424e7e4d4d81a660907c68cb97>:0) HarmonyLib.Internal.Patching.ILManipulator.ApplyTranspilers (System.Reflection.Emit.ILGenerator il, System.Reflection.MethodBase original, System.Func2[T,TResult] getLocal, System.Func1[TResult] defineLabel) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Internal.Patching.ILManipulator.WriteTo (Mono.Cecil.Cil.MethodBody body, System.Reflection.MethodBase original) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.HarmonyManipulator.WriteTranspilers () (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () (at <474744d65d8e460fa08cd5fd82b5d65f>:0) Rethrow as HarmonyException: IL Compile Error (unknown location) HarmonyLib.Public.Patching.HarmonyManipulator.WriteImpl () (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.HarmonyManipulator.Process (MonoMod.Cil.ILContext ilContext, System.Reflection.MethodBase originalMethod) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo, MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.HarmonyManipulator.Manipulate (System.Reflection.MethodBase original, MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Public.Patching.ManagedMethodPatcher.Manipulator (MonoMod.Cil.ILContext ctx) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) MonoMod.Cil.ILContext.Invoke (MonoMod.Cil.ILContext+Manipulator manip) (at <6733e342b5b549bba815373898724469>:0) MonoMod.RuntimeDetour.ILHook+Context.InvokeManipulator (Mono.Cecil.MethodDefinition def, MonoMod.Cil.ILContext+Manipulator cb) (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>?891681790(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.IEnumerable1[T] sequence, System.Action1[T] action) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) HarmonyLib.Harmony.PatchAll (System.Reflection.Assembly assembly) (at <474744d65d8e460fa08cd5fd82b5d65f>:0) Zen.Lib.ZenMod`1[TPlugin].Awake () (at <3e783025d26f49abae5dabd820736297>:0) UnityEngine.GameObject:AddComponent(Type) BepInEx.Bootstrap.Chainloader:Start() UnityEngine.GameObject:.cctor()

PlatformInitializer:EarlyInitialize()

[Mod Author]

Thanks for this, I went ahead and pushed a patch that should fix this issue.

Log in to reply.