Null pointer exception in draw loop, prevents game GUI from rendering

Started by Wastelander, February 25, 2018, 10:28:42 PM

Previous topic - Next topic

Wastelander

Hello!

I was playing A18 with some mods recently when I stumbled across this problem; I have a character who can't be drawn, and when the game tries to, an NPE bubbles up in the draw loop and prevents the GUI from rendering. :(

The specific problem behavior is that whenever the 'broken' character would be rendered, instead the whole GUI disappears. The GUI returns if you pan the camera off the problem character.

Here's the stack trace:

Object reference not set to an instance of an object
  at RimWorld.PawnUtility.GetPosture (Verse.Pawn p) [0x00000] in <filename unknown>:0
  at Verse.PawnCollisionTweenerUtility.PawnCollisionPosOffsetFor (Verse.Pawn pawn) [0x00000] in <filename unknown>:0
  at Verse.PawnTweener.TweenedPosRoot () [0x00000] in <filename unknown>:0
  at Verse.PawnTweener.ResetTweenedPosToRoot () [0x00000] in <filename unknown>:0
  at Verse.PawnTweener.PreDrawPosCalculation () [0x00000] in <filename unknown>:0
  at Verse.Pawn_DrawTracker.get_DrawPos () [0x00000] in <filename unknown>:0
  at Verse.Pawn.get_DrawPos () [0x00000] in <filename unknown>:0
  at Verse.TooltipGiverList.DispenseAllThingTooltips () [0x00000] in <filename unknown>:0
  at RimWorld.MapInterface.MapInterfaceOnGUI_BeforeMainTabs () [0x00000] in <filename unknown>:0
  at RimWorld.UIRoot_Play.UIRootOnGUI () [0x00000] in <filename unknown>:0
  at Verse.Root.OnGUI () [0x00000] in <filename unknown>:0


Though I did have mods installed and active when I encountered this, I'm hoping this could be handled regardless of mod errors; DispenseAllThingTooltips() calls giver.DrawPos, and an exception there can blow up the GUI rendering.