1.3.3080 Infinite loop while casting blinding pulse

Started by kashda, August 09, 2021, 03:34:49 PM

Previous topic - Next topic

kashda

When casting Blinding Pulse on a pawn with the Blind Psysense precept, there is an infinite loop that throws an error in the log.

Steps to Reproduce:
1) Obtain a pawn with the Blinding Pulse psycast and a pawn with a Blindsight ideology.
2) Cast Blinding Pulse on the pawn with Blindsight with dev mode on
3) (Optional) Have the Blindsight pawn fight another pawn

Observed:
There is an error thrown (see below), and the pawn is blinded more than expected from reading the tooltips.

Expected:
No errors are thrown. The tooltips clearly describe what effects the pawn is suffering from.

Notes:
I suspect that the problem is that Blind Psysense increases Psychic Sensitivity as sight decreases, and Blinding Pulse causes blindness based on Psychic Sensitivity, leading to the feedback loop. The error is repeated as the affected pawn participates in combat, likely since the pawn's vision is recalculated. The affected pawn's sight is reduced from 100% to 38%, consistent with the displayed psychic sensitivity of 1.25 if you target it again.

Error Log:

Detected infinite stat recursion when evaluating Sight
UnityEngine.StackTraceUtility:ExtractStackTrace ()
Verse.Log:Error (string)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
RimWorld.StatPart_SightPsychicSenstivityOffset:TryGetPsychicOffset (Verse.Thing,single&)
RimWorld.StatPart_SightPsychicSenstivityOffset:TransformValue (RimWorld.StatRequest,single&)
RimWorld.StatWorker:FinalizeValue (RimWorld.StatRequest,single&,bool)
RimWorld.StatWorker:GetValue (RimWorld.StatRequest,bool)
RimWorld.StatWorker:GetValue (Verse.Thing,bool)
RimWorld.StatExtension:GetStatValue (Verse.Thing,RimWorld.StatDef,bool)
Verse.PawnCapacityUtility:CalculateCapacityLevel (Verse.HediffSet,Verse.PawnCapacityDef,System.Collections.Generic.List`1<Verse.PawnCapacityUtility/CapacityImpactor>,bool)
Verse.PawnCapacitiesHandler:GetLevel (Verse.PawnCapacityDef)
Verse.PawnCapacitiesHandler:CapableOf (Verse.PawnCapacityDef)
RimWorld.PawnUtility:IsBiologicallyBlind (Verse.Pawn)
RimWorld.ThoughtWorker_Precept_Blind:ShouldHaveThought (Verse.Pawn)
RimWorld.ThoughtWorker_Precept:CurrentStateInternal (Verse.Pawn)
RimWorld.ThoughtWorker:CurrentState (Verse.Pawn)
RimWorld.SituationalThoughtHandler:TryCreateThought (RimWorld.ThoughtDef)
RimWorld.SituationalThoughtHandler:CheckRecalculateMoodThoughts ()
RimWorld.SituationalThoughtHandler:AppendMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
RimWorld.ThoughtHandler:GetAllMoodThoughts (System.Collections.Generic.List`1<RimWorld.Thought>)
RimWorld.ThoughtHandler:GetDistinctMoodThoughtGroups (System.Collections.Generic.List`1<RimWorld.Thought>)
RimWorld.ThoughtHandler:TotalMoodOffset ()
RimWorld.Need_Mood:get_CurInstantLevel ()
RimWorld.Need_Seeker:NeedInterval ()
RimWorld.Need_Mood:NeedInterval ()
RimWorld.Pawn_NeedsTracker:NeedsTrackerTick ()
Verse.Pawn:Tick ()
Verse.TickList:Tick ()
Verse.TickManager:DoSingleTick ()
Verse.TickManager:TickManagerUpdate ()
Verse.Game:UpdatePlay ()
Verse.Root_Play:Update ()

Pheanox

Thanks for the bug report.  Are you using mods for this playthrough?  Can I get a save uploaded to investigate this further? Thanks!