public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { IEnumerable <BodyPartRecord> parts = pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined, null); using (IEnumerator <BodyPartRecord> enumerator = parts.GetEnumerator()) { while (enumerator.MoveNext()) { BodyPartRecord part = enumerator.Current; if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part)) { yield return(part); } else if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part)) { yield return(part); } else if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part)) { yield return(part); } } } yield break; }
public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { IEnumerable <BodyPartRecord> parts = pawn.health.hediffSet.GetNotMissingParts(); using (IEnumerator <BodyPartRecord> enumerator = parts.GetEnumerator()) { while (enumerator.MoveNext()) { _003CGetPartsToApplyOn_003Ec__Iterator0 _003CGetPartsToApplyOn_003Ec__Iterator = (_003CGetPartsToApplyOn_003Ec__Iterator0) /*Error near IL_0088: stateMachine*/; BodyPartRecord part = enumerator.Current; if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part)) { yield return(part); /*Error: Unable to find new state assignment for yield return*/; } if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part)) { yield return(part); /*Error: Unable to find new state assignment for yield return*/; } if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part)) { yield return(part); /*Error: Unable to find new state assignment for yield return*/; } } } yield break; IL_020b: /*Error near IL_020c: Unexpected return in MoveNext()*/; }
public static Thing SpawnNaturalPartIfClean(Pawn pawn, BodyPartRecord part, IntVec3 pos, Map map) { if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part)) { return(GenSpawn.Spawn(part.def.spawnThingOnRemoved, pos, map)); } return(null); }
public static Thing SpawnNaturalPartIfClean(Pawn pawn, BodyPartRecord part, IntVec3 pos, Map map) { Thing result; if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part)) { result = GenSpawn.Spawn(part.def.spawnThingOnRemoved, pos, map, WipeMode.Vanish); } else { result = null; } return(result); }
public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { IEnumerable <BodyPartRecord> notMissingParts = pawn.health.hediffSet.GetNotMissingParts(); foreach (BodyPartRecord part in notMissingParts) { if (pawn.health.hediffSet.HasDirectlyAddedPartFor(part)) { yield return(part); } else if (MedicalRecipesUtility.IsCleanAndDroppable(pawn, part)) { yield return(part); } else if (part != pawn.RaceProps.body.corePart && part.def.canSuggestAmputation && pawn.health.hediffSet.hediffs.Any((Hediff d) => !(d is Hediff_Injury) && d.def.isBad && d.Visible && d.Part == part)) { yield return(part); } } }