RimWorld

RimWorld

Infusion 2 - Continued
Bug Report
When opening the game with this mod and [FSF] Better Exploration Loot, it gives this error:

RimWorld 1.6.4535 rev993
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Message (string)
RimWorld.VersionControl:LogVersionNumber ()
Verse.Root:CheckGlobalInit ()
Verse.Root:Start ()
Verse.Root_Entry:Start ()

XML error: <chance>0.5</chance> doesn't correspond to any field in type Option. Context: <li><chance>0.5</chance><thingSetMaker Class="ThingSetMaker_Count"><fixedParams><filter><thingDefs><li>Infusion_InfuserEmpty</li></thingDefs></filter><countRange>1~3</countRange></fixedParams></thingSetMaker></li>
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.XmlToObjectUtils:DoFieldSearch (System.Type,System.Xml.XmlNode,System.Xml.XmlNode)
Verse.DirectXmlToObjectNew:ResolveFieldForNode (System.Type,System.Xml.XmlNode,System.Xml.XmlNode)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndAddComplexTypeToList_SharedBody (object,int,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndSetListField_RimWorld_ThingSetMaker_RandomOption+Option (object,System.Reflection.FieldInfo,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndSetComplexTypeField_SharedBody (object,System.Reflection.FieldInfo,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndReturnDef_Verse_Def (int,int,System.Xml.XmlNode,System.Type)
Verse.DirectXmlToObjectNew:DefFromNodeNew (System.Xml.XmlNode,Verse.LoadableXmlAsset)
Verse.LoadedModManager:ParseAndProcessXML (System.Xml.XmlDocument,System.Collections.Generic.Dictionary`2<System.Xml.XmlNode, Verse.LoadableXmlAsset>,bool)
Verse.LoadedModManager:LoadAllActiveMods (bool)
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__10_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

XML error: <chance>0.25</chance> doesn't correspond to any field in type Option. Context: <li><chance>0.25</chance><thingSetMaker Class="Infusion.ThingSetMakerInfuser" /></li>
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.XmlToObjectUtils:DoFieldSearch (System.Type,System.Xml.XmlNode,System.Xml.XmlNode)
Verse.DirectXmlToObjectNew:ResolveFieldForNode (System.Type,System.Xml.XmlNode,System.Xml.XmlNode)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndAddComplexTypeToList_SharedBody (object,int,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndSetListField_RimWorld_ThingSetMaker_RandomOption+Option (object,System.Reflection.FieldInfo,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndSetComplexTypeField_SharedBody (object,System.Reflection.FieldInfo,System.Xml.XmlNode,System.Type)
(wrapper dynamic-method) Verse.DirectXmlToObjectNew/DummyTypeToHoldDynamicMethods:ParseAndReturnDef_Verse_Def (int,int,System.Xml.XmlNode,System.Type)
Verse.DirectXmlToObjectNew:DefFromNodeNew (System.Xml.XmlNode,Verse.LoadableXmlAsset)
Verse.LoadedModManager:ParseAndProcessXML (System.Xml.XmlDocument,System.Collections.Generic.Dictionary`2<System.Xml.XmlNode, Verse.LoadableXmlAsset>,bool)
Verse.LoadedModManager:LoadAllActiveMods (bool)
Verse.PlayDataLoader:DoPlayLoad ()
Verse.PlayDataLoader:LoadAllPlayData (bool)
Verse.Root/<>c:<Start>b__10_1 ()
Verse.LongEventHandler:RunEventFromAnotherThread (System.Action)
Verse.LongEventHandler/<>c:<UpdateCurrentAsynchronousEvent>b__28_0 ()
System.Threading.ThreadHelper:ThreadStart_Context (object)
System.Threading.ExecutionContext:RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool)
System.Threading.ExecutionContext:Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object)
System.Threading.ThreadHelper:ThreadStart ()

Thanks a lot for updating this mod!
< >
Showing 1-4 of 4 comments
Sk  [developer] Aug 3 @ 12:37am 
This was an incompatibility issue with Better Exploration Loot. I've updated the mod and added a patch to fix this issue.
Title: NRE in Infusion.Harmonize.Impact.Postfix when bullet has no target (hitThing == null)

Description:
During gameplay, when a projectile doesn’t hit any target (e.g. due to the TrueVisualMisses mod or other projectile flight modifications), the Postfix Infusion.Harmonize.Impact.Postfix assumes that both hitThing and __state are never null.
In such cases, this results in a NullReferenceException.

Log excerpt:

Exception ticking RNBullet_BlueDeath1778600: System.NullReferenceException: Object reference not set to an instance of an object
at Infusion.Harmonize.Impact.Postfix (Verse.Thing hitThing, RimWorld.Bullet __instance, Infusion.Harmonize.BulletImpactPatchState __state)
at RimWorld.Bullet.Impact (Verse.Thing hitThing, System.Boolean blockedByShield)
- PREFIX lucio.TrueVisualMisses: ...
- POSTFIX rimworld.sk.infusion: Void Infusion.Harmonize.Impact:Postfix(...)

Suggested fix:
Add null-safety checks in the Postfix:

if (__instance == null || __state == null || hitThing == null || hitThing.Destroyed) return;

This will make the mod resilient when other mods cause the bullet to have no hit target or alter the flow in Impact.

Reproduction notes:

Occurs when used with TrueVisualMisses (likely also with other mods altering projectile hits).

Happens with any bullet type if hitThing ends up null.
Sk  [developer] Aug 12 @ 2:17pm 
Thank you for the ChatGPT report, it made me chuckle. Unfortunately, this time it's incorrect. It's ok for hitThing to be null as some infusions don't require a target to activate.

The real reason why this error has surfaced is because TrueVisualMisses is making some destructive changes to the bullet mechanics which causes my mod to fail. If you test my mod in vanilla, you won't face any similar issues. I have applied the fix that ChatGPT recommended because it does improve resilience against these type of issues but I am still not too optimistic.

I've updated my mod to 1.4.6. Please try it out and if you face any more issues, do let me know because I have a feeling I might have to set this mod as incompatible. Thank you again for the report.
oldnewone Aug 13 @ 12:58am 
Thank you brother! Seems like True Visual Misses cause a lot of incompatibilities. As i am sitting at over 900 mod list i will ditch it. Anyway thanks again.
Last edited by oldnewone; Aug 13 @ 1:05am
< >
Showing 1-4 of 4 comments
Per page: 1530 50