public override void PostAdd(DamageInfo?dinfo)
 {
     if (Current.ProgramState != ProgramState.Playing || PawnGenerator.IsBeingGenerated(this.pawn))
     {
         this.IsFresh = false;
     }
     this.pawn.health.RestorePart(base.Part, this, false);
     for (int i = 0; i < base.Part.parts.Count; i++)
     {
         Hediff_MissingPart hediff_MissingPart = (Hediff_MissingPart)HediffMaker.MakeHediff(this.def, this.pawn, null);
         hediff_MissingPart.IsFresh    = false;
         hediff_MissingPart.lastInjury = this.lastInjury;
         hediff_MissingPart.Part       = base.Part.parts[i];
         this.pawn.health.hediffSet.AddDirect(hediff_MissingPart, null, null);
     }
 }
Esempio n. 2
0
 public override void PostAdd(DamageInfo?dinfo)
 {
     base.PostAdd(dinfo);
     if (Current.ProgramState != ProgramState.Playing || PawnGenerator.IsBeingGenerated(pawn))
     {
         IsFresh = false;
     }
     pawn.health.RestorePart(base.Part, this, checkStateChange: false);
     for (int i = 0; i < base.Part.parts.Count; i++)
     {
         Hediff_MissingPart hediff_MissingPart = (Hediff_MissingPart)HediffMaker.MakeHediff(def, pawn);
         hediff_MissingPart.IsFresh    = false;
         hediff_MissingPart.lastInjury = lastInjury;
         hediff_MissingPart.Part       = base.Part.parts[i];
         pawn.health.hediffSet.AddDirect(hediff_MissingPart);
     }
 }