Skip to content

NullReferenceException in ThingHelper.GetKey when pawn moves, triggered by VEF PhasingPatches (likely Miho race gene/ability) #14

Description

@evxcdwolf

RimWorld 1.6.4871 rev600, using the rimworld-1.6 branch of this fork (and Fishery rimworld-1.6).

Getting recurring exceptions while ticking pawns, right as they enter a new cell. Stack trace:

Exception ticking Корсак (at (151, 0, 180)): System.NullReferenceException: Object reference not set to an instance of an object
at PerformanceFish.Utility.ThingHelper.GetKey (Verse.Thing thing)
at FisheryLib.Collections.FishTable2[TKey,TValue].GetBucketIndex (TKey key) at FisheryLib.Collections.FishTable2[TKey,TValue].InsertAsTail (...)
at FisheryLib.Collections.FishTable2[TKey,TValue].InsertEntryInternal (...) at FisheryLib.Collections.FishTable2[TKey,TValue].InsertEntry (...)
at FisheryLib.Collections.IndexedFishSet`1[T].Add (T item)
at PerformanceFish.Listers.ThingsPrepatches.AddToTypeList (Verse.ListerThings lister, Verse.Thing thing)
at Verse.ListerThings.Add (Verse.Thing t)
at Verse.RegionListersUpdater.RegisterInRegions (Verse.Thing thing, Verse.Map map)
at Verse.Thing.set_Position (Verse.IntVec3 value)
- POSTFIX OskarPotocki.VEF: Void VEF.Hediffs.PhasingPatches:UnfogEnteredCells(Pawn_PathFollower __instance, Pawn ___pawn)
at Verse.AI.Pawn_PathFollower.TryEnterNextPathCell ()
at Verse.AI.Pawn_PathFollower.PatherTick ()
at Verse.Pawn.Tick ()
- PREFIX sakura_ta.ideotickopt: Void IdeoTickOpt.IdeoTickHarmonyPatches:PawnTickPrefix(Pawn __instance)

Right after this, a second pawn threw the same NullReferenceException at the same coordinates but during Remove (ListerThings.Remove → RemoveFromTypeList), and then two more pawns in the same area started throwing a different InvalidOperationException ("Operation is not valid due to the current state of the object") from the same IndexedFishSet, suggesting the earlier failures left the region's lister in a corrupted state.

Setup: Humanoid Alien Races with the Miho race mod active (map was mostly populated with Miho pawns at the time), plus Wolfein race mod. Not 100% sure which gene/ability on the affected pawns is triggering VEF's PhasingPatches, but it's consistently tied to VEF.Hediffs.PhasingPatches:UnfogEnteredCells in the stack.

Session ended shortly after this cluster of errors (log cuts off after a Memory Statistics dump), so this may be crashing the game.

Full log in file

Player.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions