Danimineiro / BundleOfTraits

A Rimworld Mod that adds new traits
https://steamcommunity.com/sharedfiles/filedetails/?id=2600986277
MIT License
0 stars 2 forks source link

Megascarab eating #8

Closed splincore closed 3 months ago

splincore commented 3 months ago

This mod creates a red error when a Megascarabs tries to eat. (i dont know if this is 100% of the time or not) To reproduce this bug, just start a new game in mountains or somethings, where there are caves with bugs in them. It will usually happen the first ingame day if a Megascarab is present.

My Modlist:

So i basically only have this mod active and all the DLCs.

Pawn Megascarab46963 threw exception while executing toil FinalizeIngest's finish action (0), jobDriver=RimWorld.JobDriver_Ingest, job=Ingest (Job_13422) A = Thing_InsectJelly47261 Giver = JobGiver_GetFood [workGiverDef: null], toilIndex=3: System.NullReferenceException: Object reference not set to an instance of an object [Ref 77733B11] at More_Traits.HarmonyPatching.Patches.Eclectic.EclecticPalate_FinalizeIngestPatch+<>c__DisplayClass0_0.g__action|0 () [0x0000b] in :0 at Verse.AI.Toil.Cleanup (System.Int32 myIndex, Verse.AI.JobDriver jobDriver) [0x0001f] in <957a20e0be784a65bc32cf449445b937>:0

Danimineiro commented 3 months ago

Ah, yeah that makes sense Mod is expecting human pawns there and insects don't have everything it's looking for

I'll try to push a fix within the next 24h

Danimineiro commented 3 months ago

Could reproduce, fixing

Danimineiro commented 3 months ago

The Eclectic Palate trait rates their food by number of ingredients. As insect jelly does not have ingredients, the game threw an error when attempting to read the non-existent ingredients. As the game already checks if the trait is present before applying the thought produced by eating, I had originally not made the code check for the presence of the trait, this is why the bug was also caused my the insects.

Thank you for posting the bug report and the steps to reproduce it!