kd8lvt / RimWorld-Math

A RimWorld mod
Other
4 stars 3 forks source link

NullReferenceException in IsHeldByPawn when pawn attempts to cook #2

Closed ELLIOTTCABLE closed 1 year ago

ELLIOTTCABLE commented 1 year ago
Exception in RimWorld.JobGiver_Work.TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object
  at CrunchyDuck.Math.Extensions.IsHeldByPawn (Verse.Thing thing) [0x00001] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.CachedMapData.GetThings (System.String thing_name, CrunchyDuck.Math.BillComponent bc) [0x00289] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.MathFilters.ThingFilter..ctor (CrunchyDuck.Math.BillComponent bc, System.String thing_name) [0x00025] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.CachedMapData.SearchVariable (System.String input, CrunchyDuck.Math.BillComponent bc, System.Single& count) [0x00048] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.Math.AddParameters (NCalc.Expression e, CrunchyDuck.Math.BillComponent bc, System.Collections.Generic.List`1[T] parameter_list) [0x00032] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.Math.DoMath (System.String equation, CrunchyDuck.Math.BillComponent bc, System.Single& result) [0x00131] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.Math.DoMath (System.String equation, CrunchyDuck.Math.InputField field) [0x00007] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at CrunchyDuck.Math.CountProducts_Patch.Prefix (System.Int32& __result, RimWorld.Bill_Production bill) [0x0001e] in <41cb75e8343142df8ba00bd4c4cc027d>:0 
  at Verse.RecipeWorkerCounter.CountProducts (RimWorld.Bill_Production bill) [0x0001f] in <95de19971c5d40878d8742747904cdcd>:0 
     - transpiler legodude17.HaulToBuilding: IEnumerable`1 HaulToBuilding.RecipeCountWorker_Patches:Transpiler(IEnumerable`1 instructions, ILGenerator generator, MethodBase original)
     - prefix CrunchyDuck.Math: Boolean CrunchyDuck.Math.CountProducts_Patch:Prefix(Int32& __result, Bill_Production bill)
  at RimWorld.Bill_Production.ShouldDoNow () [0x0009b] in <95de19971c5d40878d8742747904cdcd>:0 
     - prefix Wiri.compositableloadouts: Boolean Inventory.ShouldDoNow_Patch:Prefix(Boolean& __result, Bill_Production __instance)
  at RimWorld.WorkGiver_DoBill.StartOrResumeBillJob (Verse.Pawn pawn, RimWorld.IBillGiver giver) [0x00062] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.WorkGiver_DoBill.JobOnThing (Verse.Pawn pawn, Verse.Thing thing, System.Boolean forced) [0x000fb] in <95de19971c5d40878d8742747904cdcd>:0 
     - prefix VREAndroidsMod: Void VREAndroids.WorkGiver_DoBill_JobOnThing_Patch:Prefix(Pawn pawn, Thing thing, Boolean forced)
  at RimWorld.WorkGiver_Scanner.HasJobOnThing (Verse.Pawn pawn, Verse.Thing t, System.Boolean forced) [0x0002e] in <95de19971c5d40878d8742747904cdcd>:0 
     - prefix CodeOptimist.WhileYoureUp: Void JobsOfOpportunity.Mod+WorkGiver_Scanner__HasJobOnThing_Patch:CheckForSpecialHaul(Boolean& __state, Pawn pawn)
     - postfix CodeOptimist.WhileYoureUp: Void JobsOfOpportunity.Mod+WorkGiver_Scanner__HasJobOnThing_Patch:ClearTempSpecialHaul(Boolean __state, Pawn pawn)
  at RimWorld.JobGiver_Work+<>c__DisplayClass3_1.<TryIssueJobPackage>b__0 (Verse.Thing t) [0x00013] in <95de19971c5d40878d8742747904cdcd>:0 
  at Verse.GenClosest+<>c__DisplayClass2_0.<ClosestThingReachable>b__0 (Verse.Thing t) [0x00034] in <95de19971c5d40878d8742747904cdcd>:0 
  at Verse.GenClosest.<ClosestThing_Global>g__Process|5_0 (Verse.Thing t, Verse.GenClosest+<>c__DisplayClass5_0& ) [0x00047] in <95de19971c5d40878d8742747904cdcd>:0 
  at Verse.GenClosest.ClosestThing_Global (Verse.IntVec3 center, System.Collections.IEnumerable searchSet, System.Single maxDistance, System.Predicate`1[T] validator, System.Func`2[T,TResult] priorityGetter) [0x0005d] in <95de19971c5d40878d8742747904cdcd>:0 
  at Verse.GenClosest.ClosestThingReachable (Verse.IntVec3 root, Verse.Map map, Verse.ThingRequest thingReq, Verse.AI.PathEndMode peMode, Verse.TraverseParms traverseParams, System.Single maxDistance, System.Predicate`1[T] validator, System.Collections.Generic.IEnumerable`1[T] customGlobalSearchSet, System.Int32 searchRegionsMin, System.Int32 searchRegionsMax, System.Boolean forceAllowGlobalSearch, Verse.RegionType traversableRegionTypes, System.Boolean ignoreEntirelyForbiddenRegions) [0x0014c] in <95de19971c5d40878d8742747904cdcd>:0 
  at RimWorld.JobGiver_Work.TryIssueJobPackage (Verse.Pawn pawn, Verse.AI.JobIssueParams jobParams) [0x00550] in <95de19971c5d40878d8742747904cdcd>:0 
     - transpiler net.pardeike.rimworld.lib.harmony: IEnumerable`1 VisualExceptions.ExceptionsAndActivatorHandler:Transpiler(IEnumerable`1 instructions, MethodBase original)
     - transpiler Uuugggg.rimworld.Mining_Priority.main: IEnumerable`1 Mining_Priority.Prioritized_Patch:Transpiler(IEnumerable`1 instructions, MethodBase mb)
     - transpiler SmarterConstruction: List`1 SmarterConstruction.Patches.PatchMakeFinishFramesPrioritized:Transpiler(IEnumerable`1 instructions, ILGenerator generator)
     - prefix Orion.Hospitality: Boolean Hospitality.Patches.JobGiver_Work_Patch+TryIssueJobPackage:Prefix(Pawn pawn)
     - postfix PureMJ.MjRimMods.WhileYouAreNearby: Void MjRimMods.WhileYouAreNearby.TryIssueJobPackagePatch:Postfix(ThinkResult& __result, JobGiver_Work& __instance, Pawn pawn, JobIssueParams jobParams)
     - postfix ReinforcedMechanoids.Mod: Void ReinforcedMechanoids.JobGiver_Work_TryIssueJobPackage_Patch:Postfix(JobGiver_Work __instance, ThinkResult& __result, Pawn pawn, JobIssueParams jobParams)
     - postfix Krkr.Rule56: Void CombatAI.Patches.ThinkNode_Patch+ThinkNode_TryIssueJobPackage_Patch:Postfix(ThinkNode __instance, ThinkResult __result, Pawn pawn)

Visual exceptions report, full hugslib, etc: https://gist.github.com/ELLIOTTCABLE/7a46ebe638808ca7e3dd4cc10ccff173

kd8lvt commented 1 year ago

Fixed by #4