cseelhoff / RimThreaded

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

`Exception in JobDriver tick for pawn Stellarch driver=JobDriver_Reign` regarding meditation focus and throne room null reference exception to a throne. #696

Open sealvessel opened 2 years ago

sealvessel commented 2 years ago

Describe the bug

Exceptions ticking for meditation focus and grand throne in the throne room.

Steps to reproduce the behavior (VERY IMPORTANT)

  1. Make a throne room
  2. Have the royal pawn installed in the throne have a work designation for meditation at least one green square.
  3. Watch for the error.

Error Logs

Exception in JobDriver tick for pawn Stellarch driver=JobDriver_Reign (toilIndex=2) driver.job=(Reign (Job_952596) A=Thing_GrandThrone351048 B=(136, 0, 64) C=Thing_GrandThrone351048)
System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.RoomRequirement_ForbiddenBuildings.Met (Verse.Room r, Verse.Pawn p) [0x00016] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.RoomRequirement.MetOrDisabled (Verse.Room room, Verse.Pawn p) [0x0000a] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.Pawn_RoyaltyTracker+<GetUnmetThroneroomRequirements>d__79.MoveNext () [0x000f7] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RimWorld.FocusStrengthOffset_ThroneSatisfiesRequirements.CanApply (Verse.Thing parent, Verse.Pawn user) [0x00021] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.CompMeditationFocus.GetStatOffset (Verse.Pawn pawn) [0x0002d] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker_PossibleCompOffsets.GetValueUnfinalized (RimWorld.StatRequest req, System.Boolean applyPostProcess) [0x0003e] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker.GetValue (RimWorld.StatRequest req, System.Boolean applyPostProcess) [0x00042] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker.GetValue (Verse.Thing thing, Verse.Pawn pawn, System.Boolean applyPostProcess) [0x00008] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatExtension.GetStatValueForPawn (Verse.Thing thing, RimWorld.StatDef stat, Verse.Pawn pawn, System.Boolean applyPostProcess) [0x00006] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.MeditationUtility.PsyfocusGainPerTick (Verse.Pawn pawn, Verse.Thing focus) [0x00018] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.Pawn_PsychicEntropyTracker.GainPsyfocus (Verse.Thing focus) [0x00000] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at (wrapper dynamic-method) RimWorld.JobDriver_Meditate.RimWorld.JobDriver_Meditate.MeditationTick_Patch1(RimWorld.JobDriver_Meditate)
  at RimWorld.JobDriver_Reign.<MakeNewToils>b__7_3 () [0x000f8] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at (wrapper dynamic-method) Verse.AI.JobDriver.Verse.AI.JobDriver.DriverTick_Patch0(Verse.AI.JobDriver)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
Verse.AI.JobUtility:TryStartErrorRecoverJob (Verse.Pawn,string,System.Exception,Verse.AI.JobDriver)
(wrapper dynamic-method) Verse.AI.JobDriver:Verse.AI.JobDriver.DriverTick_Patch0 (Verse.AI.JobDriver)
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.JobTrackerTick_Patch0 (Verse.AI.Pawn_JobTracker)
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)

HugsLib log

Exception in JobDriver tick for pawn Stellarch driver=JobDriver_Reign (toilIndex=2) driver.job=(Reign (Job_952596) A=Thing_GrandThrone351048 B=(136, 0, 64) C=Thing_GrandThrone351048)
System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.RoomRequirement_ForbiddenBuildings.Met (Verse.Room r, Verse.Pawn p) [0x00016] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.RoomRequirement.MetOrDisabled (Verse.Room room, Verse.Pawn p) [0x0000a] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.Pawn_RoyaltyTracker+<GetUnmetThroneroomRequirements>d__79.MoveNext () [0x000f7] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RimWorld.FocusStrengthOffset_ThroneSatisfiesRequirements.CanApply (Verse.Thing parent, Verse.Pawn user) [0x00021] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.CompMeditationFocus.GetStatOffset (Verse.Pawn pawn) [0x0002d] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker_PossibleCompOffsets.GetValueUnfinalized (RimWorld.StatRequest req, System.Boolean applyPostProcess) [0x0003e] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker.GetValue (RimWorld.StatRequest req, System.Boolean applyPostProcess) [0x00042] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatWorker.GetValue (Verse.Thing thing, Verse.Pawn pawn, System.Boolean applyPostProcess) [0x00008] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.StatExtension.GetStatValueForPawn (Verse.Thing thing, RimWorld.StatDef stat, Verse.Pawn pawn, System.Boolean applyPostProcess) [0x00006] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.MeditationUtility.PsyfocusGainPerTick (Verse.Pawn pawn, Verse.Thing focus) [0x00018] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at RimWorld.Pawn_PsychicEntropyTracker.GainPsyfocus (Verse.Thing focus) [0x00000] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at (wrapper dynamic-method) RimWorld.JobDriver_Meditate.RimWorld.JobDriver_Meditate.MeditationTick_Patch1(RimWorld.JobDriver_Meditate)
  at RimWorld.JobDriver_Reign.<MakeNewToils>b__7_3 () [0x000f8] in <720a4e30fed64864bd8af057c96d4eb5>:0 
  at (wrapper dynamic-method) Verse.AI.JobDriver.Verse.AI.JobDriver.DriverTick_Patch0(Verse.AI.JobDriver)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch2 (string)
Verse.AI.JobUtility:TryStartErrorRecoverJob (Verse.Pawn,string,System.Exception,Verse.AI.JobDriver)
(wrapper dynamic-method) Verse.AI.JobDriver:Verse.AI.JobDriver.DriverTick_Patch0 (Verse.AI.JobDriver)
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.JobTrackerTick_Patch0 (Verse.AI.Pawn_JobTracker)
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)

Screenshots

image

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

sealvessel commented 2 years ago

For more information, this specifically happens when the pawn's psyfocus is at the maximum.

Niilo007 commented 2 years ago

Please include the full hugs lib log if you can still get this error to happen