ubergarm / RimWorld-KanbanStockpile

RimWorld mod adding `Stack Refill Threshold` and `Similar Stack Limit` to stockpiles and deep storage inspired by kanban logistic control systems.
https://steamcommunity.com/sharedfiles/filedetails/?id=2287142613
MIT License
2 stars 3 forks source link

WorkGiver_HaulGeneral errors with inventory Thing #16

Closed notfood closed 2 years ago

notfood commented 3 years ago

KabanStockpile red errors when pawn is asked to carry thing from inventory due to thing's map being null.

It just needs a null check before this for map. https://github.com/ubergarm/RimWorld-KanbanStockpile/blob/999ea236e0cbc8791b397998a3f73df6ec34d01c/Source/Main.cs#L102

For reference:

JobDriver threw exception in initAction for pawn PK driver=JobDriver_PlantSowWithSeeds (toilIndex=7) driver.job=(SowWithSeeds (Job_11670139) A=(113, 0, 128) B=Thing_Seed_Healroot1145147)
System.NullReferenceException: Object reference not set to an instance of an object
  at RimWorld.StoreUtility.GetSlotGroup (Verse.IntVec3 c, Verse.Map map) [0x00000] in <05a3807735854773b99a2f55213b48e4>:0 
  at KanbanStockpile.KSUtil.TryGetKanbanSettings (Verse.IntVec3 cell, Verse.Map map, KanbanStockpile.KanbanSettings& ks, RimWorld.SlotGroup& slotGroup) [0x00007] in <d471e81246d34a459d764b88f41f380e>:0 
  at KanbanStockpile.HaulAIUtility_HaulToStorageJob_Patch.Postfix (Verse.AI.Job& __result, Verse.Pawn p, Verse.Thing t) [0x0001c] in <d471e81246d34a459d764b88f41f380e>:0 
  at (wrapper dynamic-method) Verse.AI.HaulAIUtility.Verse.AI.HaulAIUtility.HaulToStorageJob_Patch1(Verse.Pawn,Verse.Thing)
  at RimWorld.WorkGiver_Haul.JobOnThing (Verse.Pawn pawn, Verse.Thing t, System.Boolean forced) [0x0000c] in <05a3807735854773b99a2f55213b48e4>:0 
  at RimWorld.WorkGiver_HaulGeneral.JobOnThing (Verse.Pawn pawn, Verse.Thing t, System.Boolean forced) [0x0000a] in <05a3807735854773b99a2f55213b48e4>:0 
  at SeedsPlease.JobDriver_PlantSowWithSeeds+<>c__DisplayClass8_0.<TryToSetAdditionalPlantingSite>b__0 () [0x0007e] in <33d31017998048a19bf1252ffc5bd94b>:0 
  at Verse.AI.JobDriver.TryActuallyStartNextToil () [0x001de] in <05a3807735854773b99a2f55213b48e4>:0  
ubergarm commented 3 years ago

Oh thanks so much notfood for the report!

After my new minecraft modpack release settles down, I plan to do update this mod before the year is out!

Cheers!