[1.1.2618] Null Reference Exception when using Carried Damage to Death

Started by ethouiche, April 29, 2020, 11:30:24 PM

Previous topic - Next topic

ethouiche

1. What the circumstances were.
Doing tests during mod creation

2. What happened.
Using Dev mode, to injure and kill a pawn

3. What you expected to happen.
Regular behavior

The debug option gives this result almost every time.
System.NullReferenceException: Object reference not set to an instance of an object
  at Verse.HealthUtility.DamageUntilDead (Verse.Pawn p) [0x00000] in <032d0428bd3b4871b44e7cd832eb5c58>:0
  at Verse.DebugToolsPawns.CarriedDamageToDeath (Verse.Pawn p) [0x0000b] in <032d0428bd3b4871b44e7cd832eb5c58>:0


Also when using other options to injure a pawn, you often get no result. It feels like you are miss clicking over and over. But the error log spams errors :
part is BodyPartRecord(Nose parts.Count=0)
It should be possible for the debug option to always find a bodypart record that is not destroyed already.

ison

CarriedDamageToDeath kills the pawn who the designated pawn is currently carrying, so if he's not carrying anyone, it's expected to fail. I believe there's another debug option for killing the designated pawn.