RimWorld

RimWorld

More Faction Interaction (Continued)
MFI causes exception for some traders
Noticed since 1.5 OR after Medieval 2 was released that some traders such as trader guild have no inventory due to error when generating inventory

Specifically when MFI is loaded with VFE-M2.

Start a game and visit a trader guild.

https://gist.github.com/HugsLibRecordKeeper/cc1516bf56a50c5b4165b726b63f40a2

Exception while generating thing set: System.NullReferenceException: Object reference not set to an instance of an object
[Ref 864793B4]
at Verse.Book.AppendDoerRules (Verse.Pawn author, Verse.Grammar.GrammarRequest& common) [0x00061] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.Book.GenerateBook (Verse.Pawn author, System.Nullable`1[T] fixedDate) [0x00169] in <24d25868955f4df08b02c73b55f389fe>:0
- PREFIX VanillaBooksExpandedMod: Void VanillaBooksExpanded.Book_GenerateBook_Patch:Prefix(Book __instance, Pawn& author, Nullable`1& fixedDate)
at Verse.Book.PostQualitySet () [0x00006] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.CompQuality.SetQuality (RimWorld.QualityCategory q, System.Nullable`1[T] source) [0x00038] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX UniqueApparel.Mod: Void UniqueApparel.DurablePatcher:Postfix_SetQuality(CompQuality __instance)
at MoreFactionInteraction.HarmonyPatches.CompQuality_TradeQualityIncreaseDestructivePreFix (RimWorld.CompQuality __instance, RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x0002b] in <b8250868117d4e8abca4fb8b5ac945e2>:0
at RimWorld.CompQuality.PostPostGeneratedForTrader (RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x0001a] in <24d25868955f4df08b02c73b55f389fe>:0
- PREFIX mehni.rimworld.MFI.main: Boolean MoreFactionInteraction.HarmonyPatches:CompQuality_TradeQualityIncreaseDestructivePreFix(CompQuality __instance, TraderKindDef trader, PlanetTile forTile, Faction forFaction)
at Verse.ThingWithComps.PostGeneratedForTrader (RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x00021] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.ThingSetMaker_TraderStock.Generate (RimWorld.ThingSetMakerParams parms, System.Collections.Generic.List`1[T] outThings) [0x0010c] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX UniqueApparel.Mod: Void UniqueApparel.Patch_ThingSetMaker_Generate:Postfix(List`1 outThings)
at RimWorld.ThingSetMaker.Generate (RimWorld.ThingSetMakerParams parms) [0x0001c] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX mehni.rimworld.MFI.main: Void MoreFactionInteraction.HarmonyPatches:TraderStocker_OverStockerPostFix(List`1& __result, ThingSetMakerParams parms)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.ThingSetMaker.Generate_Patch1 (RimWorld.ThingSetMaker,RimWorld.ThingSetMakerParams)
VFEMedieval.MerchantGuild:RegenerateStock ()
VFEMedieval.MerchantGuild:get_Goods ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.TradeDeal.AddAllTradeables_Patch1 (RimWorld.TradeDeal)
RimWorld.TradeDeal:Reset ()
RimWorld.TradeDeal:.ctor ()
RimWorld.TradeSession:SetupWith (RimWorld.ITrader,Verse.Pawn,bool)
VFEMedieval.Dialog_Barter:.ctor (Verse.Pawn,RimWorld.ITrader)
VFEMedieval.MerchantGuild/<>c__DisplayClass25_0:<BarterCommand>b__0 ()
Verse.Command_Action:ProcessInput (UnityEngine.Event)
Verse.GizmoGridDrawer:DrawGizmoGrid (System.Collections.Generic.IEnumerable`1<Verse.Gizmo>,single,Verse.Gizmo&,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>,System.Func`2<Verse.Gizmo, bool>,bool)
Verse.GizmoGridDrawer:DrawGizmoGridFor (System.Collections.Generic.IEnumerable`1<object>,Verse.Gizmo&)
RimWorld.Planet.WorldGizmoUtility:WorldUIOnGUI ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.WorldInterface.WorldInterfaceOnGUI_Patch1 (RimWorld.WorldInterface)
RimWorld.UIRoot_Play:UIRootOnGUI ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root.OnGUI_Patch1 (Verse.Root)

Exception while generating thing set: System.NullReferenceException: Object reference not set to an instance of an object
[Ref FF510778]
at Verse.Book.AppendDoerRules (Verse.Pawn author, Verse.Grammar.GrammarRequest& common) [0x00061] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.Book.GenerateBook (Verse.Pawn author, System.Nullable`1[T] fixedDate) [0x0011e] in <24d25868955f4df08b02c73b55f389fe>:0
at Verse.Book.PostQualitySet () [0x00006] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.CompQuality.SetQuality (RimWorld.QualityCategory q, System.Nullable`1[T] source) [0x0002c] in <24d25868955f4df08b02c73b55f389fe>:0
at MoreFactionInteraction.HarmonyPatches.CompQuality_TradeQualityIncreaseDestructivePreFix (RimWorld.CompQuality __instance, RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x0002b] in <b8250868117d4e8abca4fb8b5ac945e2>:0
at RimWorld.CompQuality.PostPostGeneratedForTrader (RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x0001a] in <24d25868955f4df08b02c73b55f389fe>:0
- PREFIX mehni.rimworld.MFI.main: Boolean MoreFactionInteraction.HarmonyPatches:CompQuality_TradeQualityIncreaseDestructivePreFix(CompQuality __instance, TraderKindDef trader, PlanetTile forTile, Faction forFaction)
at Verse.ThingWithComps.PostGeneratedForTrader (RimWorld.TraderKindDef trader, RimWorld.Planet.PlanetTile forTile, RimWorld.Faction forFaction) [0x00021] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.ThingSetMaker_TraderStock.Generate (RimWorld.ThingSetMakerParams parms, System.Collections.Generic.List`1[T] outThings) [0x000dc] in <24d25868955f4df08b02c73b55f389fe>:0
at RimWorld.ThingSetMaker.Generate (RimWorld.ThingSetMakerParams parms) [0x0001c] in <24d25868955f4df08b02c73b55f389fe>:0
- POSTFIX mehni.rimworld.MFI.main: Void MoreFactionInteraction.HarmonyPatches:TraderStocker_OverStockerPostFix(List`1& __result, ThingSetMakerParams parms)
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.ThingSetMaker.Generate_Patch1 (RimWorld.ThingSetMaker,RimWorld.ThingSetMakerParams)
VFEMedieval.MerchantGuild:RegenerateStock ()
VFEMedieval.MerchantGuild:get_Goods ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.TradeDeal.AddAllTradeables_Patch1 (RimWorld.TradeDeal)
RimWorld.TradeDeal:Reset ()
RimWorld.TradeDeal:.ctor ()
RimWorld.TradeSession:SetupWith (RimWorld.ITrader,Verse.Pawn,bool)
VFEMedieval.Dialog_Barter:.ctor (Verse.Pawn,RimWorld.ITrader)
VFEMedieval.CaravanArrivalAction_Barter:Arrived (RimWorld.Planet.Caravan)
RimWorld.Planet.Caravan_PathFollower:PatherArrived ()
RimWorld.Planet.Caravan_PathFollower:TryEnterNextPathTile ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.Planet.Caravan_PathFollower.PatherTickInterval_Patch1 (RimWorld.Planet.Caravan_PathFollower,int)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.Planet.Caravan.TickInterval_Patch1 (RimWorld.Planet.Caravan,int)
RimWorld.Planet.WorldObject:DoTick ()
RimWorld.Planet.WorldObjectsHolder:WorldObjectsHolderTick ()
RimWorld.Planet.World:WorldTick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)

Exception while generating thing set: System.NullReferenceException: Object reference not set to an instance of an object
[Ref FF510778] Duplicate stacktrace, see ref for original
UnityEngine.StackTraceUtility:ExtractStackTrace ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Log.Error_Patch1 (string)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.ThingSetMaker.Generate_Patch1 (RimWorld.ThingSetMaker,RimWorld.ThingSetMakerParams)
VFEMedieval.MerchantGuild:RegenerateStock ()
VFEMedieval.MerchantGuild:get_Goods ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.TradeDeal.AddAllTradeables_Patch1 (RimWorld.TradeDeal)
RimWorld.TradeDeal:Reset ()
RimWorld.TradeDeal:.ctor ()
RimWorld.TradeSession:SetupWith (RimWorld.ITrader,Verse.Pawn,bool)
VFEMedieval.Dialog_Barter:.ctor (Verse.Pawn,RimWorld.ITrader)
VFEMedieval.CaravanArrivalAction_Barter:Arrived (RimWorld.Planet.Caravan)
RimWorld.Planet.Caravan_PathFollower:PatherArrived ()
RimWorld.Planet.Caravan_PathFollower:TryEnterNextPathTile ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.Planet.Caravan_PathFollower.PatherTickInterval_Patch1 (RimWorld.Planet.Caravan_PathFollower,int)
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:RimWorld.Planet.Caravan.TickInterval_Patch1 (RimWorld.Planet.Caravan,int)
RimWorld.Planet.WorldObject:DoTick ()
RimWorld.Planet.WorldObjectsHolder:WorldObjectsHolderTick ()
RimWorld.Planet.World:WorldTick ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.TickManager.DoSingleTick_Patch1 (Verse.TickManager)
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
(wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:Verse.Root_Play.Update_Patch1 (Verse.Root_Play)