vegapnk / RJW-Genes

Rimworld Biotech Genes related to RJW
MIT License
33 stars 35 forks source link

Error on Queen Mood recalculation #60

Closed Roatze closed 1 year ago

Roatze commented 1 year ago

My game keeps crashing and this exception is the last thing in my Player.Log which occurs for every pawn.

Exception while recalculating rjw_genes_rival_queen_mood thought state for pawn Loser: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RJW_Genes.HiveUtility.PawnIsOnHomeMap (Verse.Pawn pawn) [0x00029] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RJW_Genes.Thoughtworker_RivalQueen_Mood.CurrentStateInternal (Verse.Pawn p) [0x00012] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00010] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <95de19971c5d40878d8742747904cdcd>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Exception while recalculating rjw_genes_multiple_queens_mood thought state for pawn Loser: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RJW_Genes.HiveUtility.PawnIsOnHomeMap (Verse.Pawn pawn) [0x00029] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RJW_Genes.Thoughtworker_MultipleQueens_Mood.CurrentStateInternal (Verse.Pawn p) [0x00026] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00010] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <95de19971c5d40878d8742747904cdcd>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Exception while recalculating rjw_genes_no_queen_mood thought state for pawn Loser: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RJW_Genes.HiveUtility.PawnIsOnHomeMap (Verse.Pawn pawn) [0x00029] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RJW_Genes.Thoughtworker_QueenAbsent_Mood.CurrentStateInternal (Verse.Pawn p) [0x00026] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00010] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <95de19971c5d40878d8742747904cdcd>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

Exception while recalculating rjw_genes_queen_present_mood thought state for pawn Loser: System.InvalidOperationException: Sequence contains no elements
  at System.Linq.Enumerable.First[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00010] in <351e49e2a5bf4fd6beabb458ce2255f3>:0 
  at RJW_Genes.HiveUtility.PawnIsOnHomeMap (Verse.Pawn pawn) [0x00029] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RJW_Genes.Thoughtworker_QueenPresent_Mood.CurrentStateInternal (Verse.Pawn p) [0x00026] in <183252e3855e4d60b5d7bdedba7e3627>:0 
  at RimWorld.ThoughtWorker.CurrentState (Verse.Pawn p) [0x00010] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.SituationalThoughtHandler.TryCreateThought (RimWorld.ThoughtDef def) [0x0001e] in <95de19971c5d40878d8742747904cdcd>:0  
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 39)

I currently suspect it happens due to the fact im currently playing an extremely nomadic playthrough and as such i dont actually have a home map most of the time.

vegapnk commented 1 year ago

Thanks for the report!

I will try to add some checks for it 👍