RimWorld

RimWorld

[JPT] Burn It for Fuel
Winter 3 May, 2022 @ 2:05am
Bug when using with While You Are Nearby mod
Receive the following error when only wood and coal fuel types are toggled on the fuel list.

Cannot do ClosestThingReachable searching everything without restriction.
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) Verse.Log:Verse.Log.Error_Patch4 (string)
Verse.GenClosest:EarlyOutSearch (Verse.IntVec3,Verse.Map,Verse.ThingRequest,System.Collections.Generic.IEnumerable`1<Verse.Thing>,System.Predicate`1<Verse.Thing>)
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)
(wrapper dynamic-method) BurnItForFuel.HarmonyPatches:BurnItForFuel.HarmonyPatches.FindBestFuel_Patch0 (Verse.Pawn,Verse.Thing)
(wrapper dynamic-method) BurnItForFuel.HarmonyPatches:BurnItForFuel.HarmonyPatches.FindBestFuel_Postfix_Patch0 (Verse.Pawn,Verse.Thing,Verse.Thing&)
(wrapper dynamic-method) RimWorld.RefuelWorkGiverUtility:RimWorld.RefuelWorkGiverUtility.FindBestFuel_Patch1 (Verse.Pawn,Verse.Thing)
(wrapper dynamic-method) RimWorld.RefuelWorkGiverUtility:RimWorld.RefuelWorkGiverUtility.CanRefuel_Patch1 (Verse.Pawn,Verse.Thing,bool)
RimWorld.WorkGiver_Refuel:HasJobOnThing (Verse.Pawn,Verse.Thing,bool)
RimWorld.JobGiver_Work/<>c__DisplayClass3_1:<TryIssueJobPackage>b__0 (Verse.Thing)
Verse.GenClosest/<>c__DisplayClass2_0:<ClosestThingReachable>b__0 (Verse.Thing)
Verse.GenClosest:<ClosestThing_Global>g__Process|5_0 (Verse.Thing,Verse.GenClosest/<>c__DisplayClass5_0&)
Verse.GenClosest:ClosestThing_Global (Verse.IntVec3,System.Collections.IEnumerable,single,System.Predicate`1<Verse.Thing>,System.Func`2<Verse.Thing, single>)
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)
(wrapper dynamic-method) RimWorld.JobGiver_Work:RimWorld.JobGiver_Work.TryIssueJobPackage_Patch2 (RimWorld.JobGiver_Work,Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_PrioritySorter:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams)
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.DetermineNextJob_Patch3 (Verse.AI.Pawn_JobTracker,Verse.ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob ()
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.EndCurrentJob_Patch6 (Verse.AI.Pawn_JobTracker,Verse.AI.JobCondition,bool,bool)
(wrapper dynamic-method) Verse.AI.Pawn_JobTracker:Verse.AI.Pawn_JobTracker.JobTrackerTick_Patch1 (Verse.AI.Pawn_JobTracker)
(wrapper dynamic-method) Verse.Pawn:Verse.Pawn.Tick_Patch5 (Verse.Pawn)
(wrapper dynamic-method) Verse.TickList:Verse.TickList.Tick_Patch2 (Verse.TickList)
(wrapper dynamic-method) Verse.TickManager:Verse.TickManager.DoSingleTick_Patch4 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
(wrapper dynamic-method) Verse.Game:Verse.Game.UpdatePlay_Patch1 (Verse.Game)
(wrapper dynamic-method) Verse.Root_Play:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)
< >
Showing 1-1 of 1 comments
pureMJ 4 May, 2022 @ 9:00pm 
Dear mod author,

Based on the stacktrace above, it appear your mod does a very expensive global search for
WorkGiver_Refuel:HasJobOnThing
. That is probably not gonna help late game performance.

The above error is simply manifest of that issue (the vanilla game code complains you are trying to do a global search against *everything*).

Maybe it is worth looking into somehow cache some results and avoid expensive searches for
HasJobOnThing()
.
< >
Showing 1-1 of 1 comments
Per page: 1530 50