pardeike / Zombieland

Rimworld Mod featuring zombie hordes
https://www.patreon.com/pardeike
MIT License
55 stars 22 forks source link

NullReferenceException when putting babies somewhere safe. #69

Closed wrobell89 closed 1 year ago

wrobell89 commented 1 year ago

BabyError.zip

I'm getting an null ref exception when pawns try to move babies to a crib. Originally encountered organically in a heavily modded game, but I tested with just harmony and zombieland, and it still happens.

Steps to reproduce:

  1. enable harmony and zombieland mods.
  2. enable dev mode
  3. start quick test game (from main menu)
  4. use "Give birth" command on starting pawn.
  5. Put down baby sleeping spots and wait for pawns to try and get babies to safety.
  6. Pawns pick up babies and walk around never putting them down. Null ref exception keeps getting thrown in the logs.
Exception in BreadthFirstTraverse: System.NullReferenceException: Object reference not set to an instance of an object
  at ZombieLand.Tools.ShouldAvoidZombies (Verse.Pawn pawn) [0x000a6] in <877503fe7ab2478f8b190f948f09f089>:0 
  at ZombieLand.Patches+DangerUtility_GetDangerFor_Patch.Postfix (Verse.IntVec3 c, Verse.Pawn p, Verse.Map map, Verse.Danger& __result) [0x00010] in <877503fe7ab2478f8b190f948f09f089>:0 
  at (wrapper dynamic-method) Verse.DangerUtility.Verse.DangerUtility.GetDangerFor_Patch1(Verse.IntVec3,Verse.Pawn,Verse.Map)
  at RimWorld.RestUtility+<>c__DisplayClass13_3.<FindBedFor>b__1 (Verse.Thing b) [0x0003b] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at Verse.RegionProcessorClosestThingReachable.RegionProcessor (Verse.Region reg) [0x000f2] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at Verse.RegionTraverser+BFSWorker.BreadthFirstTraverseWork (Verse.Region root, Verse.RegionEntryPredicate entryCondition, Verse.RegionProcessor regionProcessor, System.Int32 maxRegions, Verse.RegionType traversableRegionTypes) [0x00054] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
  at Verse.RegionTraverser.BreadthFirstTraverse (Verse.Region root, Verse.RegionEntryPredicate entryCondition, Verse.RegionProcessor regionProcessor, System.Int32 maxRegions, Verse.RegionType traversableRegionTypes) [0x00044] in <3cca3e6203e64b109fd8ce21f7120d03>:0 
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.RegionTraverser:BreadthFirstTraverse (Verse.Region,Verse.RegionEntryPredicate,Verse.RegionProcessor,int,Verse.RegionType)
Verse.RegionTraverser:BreadthFirstTraverse (Verse.Region,Verse.RegionProcessorDelegateCache,int,Verse.RegionType)
Verse.GenClosest:RegionwiseBFSWorker (Verse.IntVec3,Verse.Map,Verse.ThingRequest,Verse.AI.PathEndMode,Verse.TraverseParms,System.Predicate`1<Verse.Thing>,System.Func`2<Verse.Thing, single>,int,int,single,int&,Verse.RegionType,bool)
Verse.GenClosest:ClosestThingReachable (Verse.IntVec3,Verse.Map,Verse.ThingRequest,Verse.AI.PathEndMode,Verse.TraverseParms,single,System.Predicate`1<Verse.Thing>,System.Collections.Generic.IEnumerable`1<Verse.Thing>,int,int,bool,Verse.RegionType,bool)
RimWorld.RestUtility:FindBedFor (Verse.Pawn,Verse.Pawn,bool,bool,System.Nullable`1<RimWorld.GuestStatus>)
RimWorld.ChildcareUtility:SafePlaceForBaby (Verse.Pawn,Verse.Pawn)
RimWorld.JobDriver_BringBabyToSafety/<>c__DisplayClass6_0:<FindBedForBaby>b__0 ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:Notify_PatherArrived ()
Verse.AI.Pawn_PathFollower:PatherArrived ()
(wrapper dynamic-method) Verse.AI.Pawn_PathFollower:Verse.AI.Pawn_PathFollower.StartPath_Patch0 (Verse.AI.Pawn_PathFollower,Verse.LocalTargetInfo,Verse.AI.PathEndMode)
Verse.AI.Toils_Goto/<>c__DisplayClass1_0:<GotoThing>b__0 ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
Verse.AI.JobDriver:TryActuallyStartNextToil ()
Verse.AI.JobDriver:ReadyForNextToil ()
(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,System.Nullable`1<bool>,bool,bool)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
Verse.AI.Pawn_JobTracker:EndCurrentJob (Verse.AI.JobCondition,bool,bool)
Verse.AI.Pawn_JobTracker:JobTrackerTick ()
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch1 (Verse.Pawn)
Verse.TickList:Tick ()
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.TickManagerUpdate_Patch2 (Verse.TickManager)
Verse.Game:UpdatePlay ()
(wrapper dynamic-method) Verse.Root_Play:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)
pardeike commented 1 year ago

Thnx, fixed in the upcoming release

wrobell89 commented 1 year ago

Thnx, fixed in the upcoming release

Awesome! Thx!