cseelhoff / RimThreaded

RimThreaded is a RimWorld mod designed to enable RimWorld to utilize multiple threads.
MIT License
119 stars 21 forks source link

Exception while recalculating IdeoDiversity disapproved altar sharing #706

Open sealvessel opened 2 years ago

sealvessel commented 2 years ago

Describe the bug

Error with ideologion relating to altar sharing.

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Download save
  2. Click the ideologion tab, change the "bigotry" of diversity of thought to anything that is bigotry. See that every pawn with that ideologion errors.

    Error Logs

    Exception while recalculating IdeoDiverity_Disapproved_AltarSharing thought state for pawn Bernard: System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
    at System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) [0x0000b] in <eae584ce26bc40229c1b1aa476bfa589>:0 
    at System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () [0x00013] in <eae584ce26bc40229c1b1aa476bfa589>:0 
    at System.Collections.Generic.List`1+Enumerator[T].MoveNext () [0x0004a] in <eae584ce26bc40229c1b1aa476bfa589>:0 
    at RimWorld.ThoughtWorker_Precept_AltarSharing.SharedAltar (Verse.Pawn pawn) [0x000e0] in <720a4e30fed64864bd8af057c96d4eb5>:0 
    at RimWorld.ThoughtWorker_Precept_AltarSharing.ShouldHaveThought (Verse.Pawn p) [0x00000] in <720a4e30fed64864bd8af057c96d4eb5>:0 
    at RimWorld.ThoughtWorker_Precept.CurrentStateInternal (Verse.Pawn p) [0x00010] in <720a4e30fed64864bd8af057c96d4eb5>:0 
    at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00000] in <720a4e30fed64864bd8af057c96d4eb5>:0 
    at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <720a4e30fed64864bd8af057c96d4eb5>:0 
    UnityEngine.StackTraceUtility:ExtractStackTrace ()
    (wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
    RimWorld.SituationalThoughtHandler:TryCreateThought (RimWorld.ThoughtDef)
    RimThreaded.SituationalThoughtHandler_Patch:CheckRecalculateMoodThoughts (RimWorld.SituationalThoughtHandler)
    (wrapper dynamic-method) RimWorld.SituationalThoughtHandler:RimWorld.SituationalThoughtHandler.CheckRecalculateMoodThoughts_Patch1 (RimWorld.SituationalThoughtHandler)
    RimWorld.SituationalThoughtHandler:AppendMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
    RimWorld.ThoughtHandler:GetAllMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
    RimWorld.ThoughtHandler:GetDistinctMoodThoughtGroups (System.Collections.Generic.List`1<RimWorld.Thought>)
    (wrapper dynamic-method) RimWorld.ThoughtHandler:RimWorld.ThoughtHandler.TotalMoodOffset_Patch0 (RimWorld.ThoughtHandler)
    RimWorld.Need_Mood:get_CurInstantLevel ()
    RimWorld.Need_Seeker:NeedInterval ()
    RimWorld.Need_Mood:NeedInterval ()
    RimWorld.Pawn_NeedsTracker:NeedsTrackerTick ()
    Verse.Pawn:Tick ()
    RimThreaded.TickList_Patch:NormalThingTick ()
    RimThreaded.RimThreaded:ExecuteTicks ()
    RimThreaded.RimThreaded:ProcessTicks (RimThreaded.RimThreaded/ThreadInfo)
    RimThreaded.RimThreaded:InitializeThread (object)
    System.Threading.ThreadHelper:ThreadStart_Context (object)
    System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
    System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
    System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
    System.Threading.ThreadHelper:ThreadStart (object)

    Player.log

    Player.log.zip

    HugsLib log

    https://gist.github.com/17ed3cdf4297d313451595eb5811b6e9

Save file

Quicksave.rws.zip

Screenshots

!!! Add screenshots to help explain your problem here !!!

Mod list (For vanilla report, it has to be same as below list.)

Niilo007 commented 2 years ago

please see if this happens in 2.5.16

sealvessel commented 2 years ago

Still happens.

image