Ludeon Forums

RimWorld => Support => Topic started by: pegonzi on January 13, 2022, 04:07:57 PM

Title: crash upon caravan settle/map spawn
Post by: pegonzi on January 13, 2022, 04:07:57 PM
Oh Kind Soul out there, please help me understand where the critical exception lies...

Problem arises when I try to settle with my caravan in any new spot. Oddly enough, it's the second time in this playthrough that I move to a new settlement and the first time I didn't experience any problem. I havent changed mods or anything since then. The problem does not arise if I enter a spot that doesn't require spawning a map, like attacking an enemy settlement or entering crashed ship endgame site.

The red message on the dev console says:

Exception from asynchronous event: System.NullReferenceException: Object reference not set to an instance of an object
  at RimFridge.Patch_ReachabilityUtility_CanReach.Prefix (System.Boolean& __result, Verse.Pawn pawn, Verse.LocalTargetInfo dest, Verse.AI.PathEndMode peMode, Verse.Danger maxDanger, System.Boolean canBashDoors, Verse.TraverseMode mode) [0x00055] in <7aebbc366ebd4b4fa9d064a9c9b49f31>:0
  at (wrapper dynamic-method) Verse.ReachabilityUtility.Verse.ReachabilityUtility.CanReach_Patch1(Verse.Pawn,Verse.LocalTargetInfo,Verse.AI.PathEndMode,Verse.Danger,bool,bool,Verse.TraverseMode)
  at Verse.AI.HaulAIUtility.PawnCanAutomaticallyHaulFast (Verse.Pawn p, Verse.Thing t, System.Boolean forced) [0x00062] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at Verse.AI.Pawn_JobTracker.TryOpportunisticJob (Verse.AI.Job job) [0x00199] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.Verse.AI.Pawn_JobTracker.StartJob_Patch1(Verse.AI.Pawn_JobTracker,Verse.AI.Job,Verse.AI.JobCondition,Verse.AI.ThinkNode,bool,bool,Verse.ThinkTreeDef,System.Nullable`1<Verse.AI.JobTag>,bool,bool)
  at Verse.AI.Pawn_JobTracker.TryFindAndStartJob () [0x000bb] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at (wrapper dynamic-method) Verse.AI.Pawn_JobTracker.Verse.AI.Pawn_JobTracker.EndCurrentJob_Patch1(Verse.AI.Pawn_JobTracker,Verse.AI.JobCondition,bool,bool)
  at RimWorld.Planet.CaravanFormingUtility.StartReturnedLord (System.Collections.Generic.List`1[T] pawns) [0x0008c] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at RimWorld.Planet.CaravanFormingUtility.LeadAnimalsToPen (System.Collections.Generic.List`1[T] pawns) [0x0014d] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at (wrapper dynamic-method) RimWorld.Planet.CaravanEnterMapUtility.RimWorld.Planet.CaravanEnterMapUtility.Enter_Patch2(RimWorld.Planet.Caravan,Verse.Map,System.Func`2<Verse.Pawn, Verse.IntVec3>,RimWorld.Planet.CaravanDropInventoryMode,bool)
  at RimWorld.Planet.CaravanEnterMapUtility.Enter (RimWorld.Planet.Caravan caravan, Verse.Map map, RimWorld.Planet.CaravanEnterMode enterMode, RimWorld.Planet.CaravanDropInventoryMode dropInventoryMode, System.Boolean draftColonists, System.Predicate`1[T] extraCellValidator) [0x00073] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at RimWorld.Planet.SettleInEmptyTileUtility+<>c__DisplayClass1_0.<Settle>b__1 () [0x00028] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
  at Verse.LongEventHandler.RunEventFromAnotherThread (System.Action action) [0x00008] in <cdbd0ed5089a418da09b9a259f9dbd8f>:0
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__27_0 ()
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 ()

The full log can be found here: https://gist.github.com/23c13be32b85519cc9c12b82ffc22c7b

Can anybody pretty please enlighten me?
Thanks! :)
Title: Re: crash upon caravan settle/map spawn
Post by: Canute on January 13, 2022, 04:19:43 PM
Hi,
we shortly got a similar problem
https://ludeon.com/forums/index.php?topic=55765.0
Try to remove Rimfridge, maybe remove all fridge's before you disable the mods, and check if it helps.

Title: Re: crash upon caravan settle/map spawn
Post by: pegonzi on January 13, 2022, 04:52:43 PM
It worked! Thank you good Sir!
I removed fridges from the caravan inventory, removed rimFridge mod, entered the area.. and then I reactivated the mod, 'cause, you know, fridges are awesome :)
Thank you thank you thank you! I owe you a beer!
Title: Re: crash upon caravan settle/map spawn
Post by: Kiame on January 13, 2022, 05:17:18 PM
RimFridge was updated a week ago to hopefully prevent this. What version of the mod was this?

In any case here's a link for the current version: https://github.com/KiameV/rimworld-rimfridge/releases/download/1.3/RimFridge.zip
Title: Re: crash upon caravan settle/map spawn
Post by: Canute on January 14, 2022, 04:12:57 AM
The github link allready show that he use
[KV] RimFridge(rimfridge.kv.rw)[ov:1.3.1.1]: RimFridge(1.2.1)
That's why i contact you. Special since the error is different from the other one, a week ago.
Title: Re: crash upon caravan settle/map spawn
Post by: Kiame on January 14, 2022, 11:22:18 PM
Quote from: Canute on January 14, 2022, 04:12:57 AM
The github link allready show that he use
[KV] RimFridge(rimfridge.kv.rw)[ov:1.3.1.1]: RimFridge(1.2.1)
That's why i contact you. Special since the error is different from the other one, a week ago.

Thanks Canute for pointing that out and sorry RL is busy atm so not committing enough time for looking at logs. I've update RimFridge to include one more null check (i already had them plastered throughout this method lol) and wrapped in a try/catch for extra protection. Hopefully this'll fix the issue.

v1.3.1.2 (https://github.com/KiameV/rimworld-rimfridge/releases/download/1.3/RimFridge.zip)