Vanilla-Expanded / VanillaExpandedFramework

Vanilla Expanded Framework for RimWorld
Other
69 stars 34 forks source link

Destructive code will make VEF incompatible with mods like Achtung #96

Open pardeike opened 4 months ago

pardeike commented 4 months ago

Skipping the original method call and all prefixes of other mods that come after you will make for a pretty incompatible situation. This should be solved differently and affects my mod Achtung.

https://github.com/Vanilla-Expanded/VanillaExpandedFramework/blob/7dcaa782dedbae3e99390e6be966f1f092c0a15c/Source/VFECore/AnimalBehaviours/Harmony/Draftability/FloatMenuMakerMap_AddJobGiverWorkOrders.cs#L21

juanosarg commented 4 months ago

Hi Brrainz! I added such a patch because if it isn't there draftable animals generate a NRE when undrafted and right clicking a worktable with standing bills. The problem is I'm not sure where the NRE is happening inside AddJobGiverWorkOrders:

Error trying to make float menu for GR_Booman10162: System.NullReferenceException: Object reference not set to an instance of an object [Ref 592F3CBD] at RimWorld.FloatMenuMakerMap.AddJobGiverWorkOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List1[T] opts, System.Boolean drafted) [0x0038c] in <957a20e0be784a65bc32cf449445b937>:0 at RimWorld.FloatMenuMakerMap.AddUndraftedOrders (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Collections.Generic.List1[T] opts) [0x00024] in <957a20e0be784a65bc32cf449445b937>:0 at RimWorld.FloatMenuMakerMap.ChoicesAtFor (UnityEngine.Vector3 clickPos, Verse.Pawn pawn, System.Boolean suppressAutoTakeableGoto) [0x00126] in <957a20e0be784a65bc32cf449445b937>:0

juanosarg commented 4 months ago

I think the culprit is pawn.workSettings being null