ZigTheHedge / vsmods

4 stars 4 forks source link

Game crash on world load (survivalcats) #12

Open IronFractal opened 1 year ago

IronFractal commented 1 year ago

Getting this crash occasionally on world load.

Game Version: v1.17.9 (Stable)
12/10/2022 8:34:33 PM: Critical error occurred in the following mod: survivalcats@1.2.3-rc.2
Loaded Mods: AMFinder@1.1.5, betterarchery@3.0.0, foundrymod@1.0.0, OresAPlenty@3.0.0, GrindLess@1.1.2, shortgrass@1.0.0, Subtitles@0.2.1, survivalcats@1.2.3-rc.2, game@1.17.9, vshud@2.1.0, additionalmolds@1.0.1, alloycalculator@1.0.0, farmlanddropssoil@1.4.0, hudclock@2.8.0, playercorpse@1.5.5, prospectorinfo@4.1.2, vgaas@1.0.0, creative@1.17.9, survival@1.17.9, xlib@0.6.10, metalrecovery@0.1.18-rc.2, campaigncartographer@3.0.3, xskills@0.6.13
Involved Harmony IDs: com.cwelth.survivalcats
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
  at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00016] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
  at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x00050] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
  at survivalcats.src.PatcherLoadEntries.Postfix (System.Collections.Generic.List`1[T] ___categoryCodes, System.Collections.Generic.List`1[T] ___allHandbookPages, Vintagestory.API.Client.ICoreClientAPI ___capi) [0x00263] in <949f2a295ea84302af9157858c37be5d>:0 
  at (wrapper dynamic-method) Vintagestory.GameContent.GuiDialogHandbook.Vintagestory.GameContent.GuiDialogHandbook.loadEntries_Patch1(Vintagestory.GameContent.GuiDialogHandbook)
  at Vintagestory.GameContent.GuiDialogHandbook..ctor (Vintagestory.API.Client.ICoreClientAPI capi) [0x000ce] in <b64b70fbdbd94ce2a8289199cd50dea9>:0 
  at survivalcats.src.GuiDialogHandbookBookmarks..ctor (Vintagestory.API.Client.ICoreClientAPI capi) [0x00000] in <949f2a295ea84302af9157858c37be5d>:0 
  at (wrapper dynamic-method) Vintagestory.GameContent.ModSystemHandbook.Vintagestory.GameContent.ModSystemHandbook.Event_LevelFinalize_Patch0(Vintagestory.GameContent.ModSystemHandbook)
  at (wrapper delegate-invoke) <Module>.invoke_void()
  at Vintagestory.Client.NoObf.ClientEventAPI.TriggerLevelFinalize () [0x0000a] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.ClientMain.OnLevelFinalize () [0x00038] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.GeneralPacketHandler.HandleLevelFinalize (Packet_Server packet) [0x0002a] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.ProcessPacketTask.ProcessPacket (Packet_Server packet) [0x00016] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.ProcessPacketTask.Run () [0x00000] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.ClientMain.ExecuteMainThreadTasks (System.Single deltaTime) [0x0008e] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.GuiScreenConnectingToServer.RenderToDefaultFramebuffer (System.Single dt) [0x0041f] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.ScreenManager.Render (System.Single dt) [0x001df] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.ScreenManager.OnNewFrame (System.Single dt) [0x000cc] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at Vintagestory.Client.NoObf.ClientPlatformWindows.window_RenderFrame (System.Object sender, OpenTK.FrameEventArgs e) [0x00141] in <f8e7e0ea709348ba8693d95fd255ff41>:0 
  at (wrapper delegate-invoke) System.EventHandler`1[OpenTK.FrameEventArgs].invoke_void_object_TEventArgs(object,OpenTK.FrameEventArgs)
  at OpenTK.GameWindow.OnRenderFrame (OpenTK.FrameEventArgs e) [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.OnRenderFrameInternal (OpenTK.FrameEventArgs e) [0x00010] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.RaiseRenderFrame (System.Double elapsed, System.Double& timestamp) [0x0000c] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.DispatchRenderFrame () [0x00038] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.Run (System.Double updates_per_second, System.Double frames_per_second) [0x00104] in <a4886e33f9fc416195d24950e7205b94>:0 
  at OpenTK.GameWindow.Run () [0x00000] in <a4886e33f9fc416195d24950e7205b94>:0 
  at Vintagestory.Client.ClientProgram.Start (Vintagestory.Client.ClientProgramArgs args, System.String[] rawArgs) [0x003f2] in <fd9d0c679a80472ab783dcb948963ece>:0 
  at Vintagestory.Client.ClientProgram+<>c__DisplayClass14_0.<.ctor>b__0 () [0x00000] in <fd9d0c679a80472ab783dcb948963ece>:0 
  at Vintagestory.ClientNative.CrashReporter.Start (System.Threading.ThreadStart start) [0x00007] in <f8e7e0ea709348ba8693d95fd255ff41>:0 

Issue seems to be in the Postfix function in Patcher.cs.

Might be solved with this https://stackoverflow.com/questions/604831/collection-was-modified-enumeration-operation-may-not-execute, but I was not able to get a working dev environment to test.