Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

Incompatibility with Real Fog of War #22

@Vectorial1024

Description

@Vectorial1024

As reported by Steam user Rafferty, there are some errors when using this mod with Real Fog of War.

Example error log follows.

JobDriver threw exception in initAction for pawn Atkinson driver=JobDriver_Kidnap (toilIndex=4) driver.job=(Kidnap (Job_2029) A=Thing_Human642 B=(145, 0, 0)) lastJobGiver=RimWorld.JobGiver_Kidnap
System.NullReferenceException: Object reference not set to an instance of an object
at RimWorldRealFoW.Detours._LetterStack.ReceiveLetter_Prefix (Verse.LookTargets&) <0x0004b>
at (wrapper dynamic-method) Verse.LetterStack.ReceiveLetter_Patch1 (object,string,string,Verse.LetterDef,Verse.LookTargets,RimWorld.Faction,string) <0x0002c>
at Desynchronized.Handlers.Handler_PawnKidnapped.SendOutNotificationLetter (Verse.Pawn,Verse.Pawn) <0x00240>
at Desynchronized.Handlers.Handler_PawnKidnapped.HandlePawnKidnapped (Verse.Pawn,Verse.Pawn) <0x0001c>
at Desynchronized.Patches.PostFix_Pawn_PreKidnapped.PostFix (Verse.Pawn,Verse.Pawn) <0x00024>
at (wrapper dynamic-method) Verse.Pawn.PreKidnapped_Patch1 (object,Verse.Pawn) <0x00247>
at RimWorld.KidnappedPawnsTracker.Kidnap (Verse.Pawn,Verse.Pawn) <0x000e1>
at Verse.Pawn.ExitMap (bool,Verse.Rot4) <0x00285>
at RimWorld.JobDriver_TakeAndExitMap/<MakeNewToils>c__Iterator0.<>m__1 () <0x001d9>
at Verse.AI.JobDriver.TryActuallyStartNextToil () <0x0071f>

Verse.Log:Error(String, Boolean)
Verse.AI.JobUtility:TryStartErrorRecoverJob(Pawn, String, Exception, JobDriver)
Verse.AI.JobDriver:TryActuallyStartNextToil()
Verse.AI.JobDriver:ReadyForNextToil()

The relevant source code of Real Fog of War is available here: https://github.com/lukakama/rimworld-mod-real-fow/blob/master/Sources/RimWorldRealFoW/Detours/_LetterStack.cs

By inspecting the source code, one may find that Real Fog of War boldly assumed that the "pointer" of a Letter will point to a PrimaryTarget. However, in our case, the Kidnap Letter does not point to any target. Hence, the NullReferenceException is thrown.

It might be possible to patch against this error.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions