erdelf / AlienRaces

Rimworld mod alien race framework
MIT License
105 stars 69 forks source link

Cannibalism in kibble prevents pawns to find food #25

Closed VorChar closed 5 years ago

VorChar commented 5 years ago

I'm running Lizardmen custom race by Owlchemist, Nagas by Syrchalis and happened to get some lizardmen meat and turned it into kibble and afterwards noticed that my pawns would not eat food on their own and I could not feed prisoners. Turns out the problem was finding food source and the kibble returned null pointer exception. The custom race is carnivorous so they can eat kibble. There was a some sort of fix for cannibalism about week ago but this didn't seem to affect kibble breaking the game

Exception in Verse.AI.ThinkNode_PrioritySorter TryIssueJobPackage: System.NullReferenceException: Object reference not set to an instance of an object at AlienRace.HarmonyPatches/<>c.<ThoughtsFromIngestingPostfix>b__72_1 (Verse.ThingDef) <0x00017> at System.Linq.Enumerable.First<Verse.ThingDef> (System.Collections.Generic.IEnumerable'1<Verse.ThingDef>,System.Func'2<Verse.ThingDef, bool>,System.Linq.Enumerable/Fallback) <0x000c5> at System.Linq.Enumerable.FirstOrDefault<Verse.ThingDef> (System.Collections.Generic.IEnumerable'1<Verse.ThingDef>,System.Func'2<Verse.ThingDef, bool>) <0x0005e> at AlienRace.HarmonyPatches.ThoughtsFromIngestingPostfix (Verse.Pawn,Verse.Thing,System.Collections.Generic.List'1<RimWorld.ThoughtDef>&) <0x00465> at (wrapper dynamic-method) RimWorld.FoodUtility.ThoughtsFromIngesting_Patch1 (Verse.Pawn,Verse.Thing,Verse.ThingDef) <0x003a0> at (wrapper dynamic-method) RimWorld.FoodUtility.FoodOptimality_Patch1 (Verse.Pawn,Verse.Thing,Verse.ThingDef,single,bool) <0x0023b> at RimWorld.FoodUtility.SpawnedFoodSearchInnerScan (Verse.Pawn,Verse.IntVec3,System.Collections.Generic.List'1<Verse.Thing>,Verse.AI.PathEndMode,Verse.TraverseParms,single,System.Predicate'1<Verse.Thing>) <0x001c7> at RimWorld.FoodUtility.BestFoodSourceOnMap (Verse.Pawn,Verse.Pawn,bool,Verse.ThingDef&,RimWorld.FoodPreferability,bool,bool,bool,bool,bool,bool,bool,bool,bool) <0x00602> at RimWorld.FoodUtility.TryFindBestFoodSourceFor (Verse.Pawn,Verse.Pawn,bool,Verse.Thing&,Verse.ThingDef&,bool,bool,bool,bool,bool,bool,bool) <0x002cf> at RimWorld.JobGiver_GetFood.TryGiveJob (Verse.Pawn) <0x001f7> at Verse.AI.ThinkNode_JobGiver.TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams) <0x00039> at Verse.AI.ThinkNode_PrioritySorter.TryIssueJobPackage (Verse.Pawn,Verse.AI.JobIssueParams) <0x0056b>

Flixbox commented 5 years ago

I have the same issue. Disallowing my pawns to consume kibble doesn't help.

Flixbox commented 5 years ago

Update - I managed to find a workaround:

Flixbox commented 5 years ago

Apparently reinstalling an older version helps too: https://www.reddit.com/r/rimworld/comments/cfy4u7/_/ev5zn26?context=1000

Flixbox commented 5 years ago

This commit might be the root cause of our issue. The line sounds a lot like our error message. https://github.com/RimWorld-CCL-Reborn/AlienRaces/commit/642365c672043d73729cdb0e3477348a50eebb78