Ejemplo n.º 1
0
 private static bool Prefix(Pawn ___pawn, Hediff hediff)
 {
     if (!RaceAddonTools.CheckHediff(___pawn.def, hediff.def))
     {
         return(false);
     }
     if (___pawn.def is RaceAddonThingDef thingDef)
     {
         if (thingDef.raceAddonSettings.hediffSetting.replacedHediffs != null)
         {
             var replacedHediff = thingDef.raceAddonSettings.hediffSetting.replacedHediffs.Find(x => x.originalHediffDef == hediff.def);
             if (replacedHediff != null)
             {
                 hediff.def = replacedHediff.replacedHediffDef;
             }
         }
     }
     return(true);
 }