[1.0.2096] Exception ticking hediff (Alzheimers ...

Started by k2ymg, December 09, 2018, 05:09:05 PM

Previous topic - Next topic

k2ymg

--
Exception ticking hediff (Alzheimers 脳 ticksSinceCreation=93821) for pawn Thornton. Removing hediff... Exception: System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.Hediff.Tick () [0x00000] in <filename unknown>:0
  at Verse.Pawn_HealthTracker.HealthTick () [0x00000] in <filename unknown>:0
Verse.Log:Error(String, Boolean)
Verse.Pawn_HealthTracker:HealthTick()
Verse.Pawn:Tick()
RimWorld.Planet.WorldPawns:WorldPawnsTick()
RimWorld.Planet.World:WorldTick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
--

Sometime appear. '脳' is  'brain'.

Canute

k2ymg,
could you please read the sticky please.
The error msg. alone isn't very helpful, the complete log file, when it happen, and maybe a safegame when it happen might more useful.

k2ymg

https://www.dropbox.com/s/ohsejq6epbgw719/a.zip?dl=0

Today I faced this again and have kept the both files but it's not reproduce. seems random. same things are WorldPawn and Alzheimer.

Canute


Kenneth

I couldn't reproduce this error, I spawned Rea in as colonist taken from the world pawns and she has the Alzheimer's hediff, I did wait some time for the issue to appear without success.
This error might be caused by the mods you're using, but their names don't suggest they change something that could cause this (however, it's possible).

Did anyone else have this problem? Probably even in a vanilla game?

k2ymg

I suppose this will occur when HeartArteryBlockage gave HeartAttack, HeartAttack caused death, and occurred forgetMemoryThoughtMtbDays of Alzheimers in single frame. I just read the code, I didn't reproduce anything. This is simply my suppose.


Pawn_HealthTracker.HealthTick
Dead? <- dead check here. out side of Hediffs loop.
for(...){
  Hediff.Tick -> HeartArteryBlockage
   HediffGiver_Random.OnIntervalPassed
    HediffGiver.TryApply
     HediffGiverUtility.TryApply
      HealthTracker.AddHediff -> add HeartAttack
       CheckForStateChange
        ShouldBeDead -> quickly dead?
         Pawn.Kill
          Pawn_HealthTracker.SetDead <- here mark to death..
          PawnComponentUtility.RemoveComponentsOnKilled <- Pawn.needs to null

...
  // next loop, Alzheimer
  process forgetMemoryThoughtMtbDays <- reference Pawn.needs here
...
}

Kenneth

You are correct, I fixed it.
Thanks for reporting and investigating! ;)