public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { for (int j = 0; j < recipe.appliedOnFixedBodyParts.Count; j++) { BodyPartDef part = recipe.appliedOnFixedBodyParts[j]; List <BodyPartRecord> bpList = pawn.RaceProps.body.AllParts; for (int i = 0; i < bpList.Count; i++) { _003CGetPartsToApplyOn_003Ec__Iterator0 _003CGetPartsToApplyOn_003Ec__Iterator = (_003CGetPartsToApplyOn_003Ec__Iterator0) /*Error near IL_0081: stateMachine*/; BodyPartRecord record = bpList[i]; if (record.def == part) { IEnumerable <Hediff> diffs = from x in pawn.health.hediffSet.hediffs where x.Part == record select x; if ((diffs.Count() != 1 || diffs.First().def != recipe.addsHediff) && (record.parent == null || pawn.health.hediffSet.GetNotMissingParts().Contains(record.parent)) && (!pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(record) || pawn.health.hediffSet.HasDirectlyAddedPartFor(record))) { yield return(record); /*Error: Unable to find new state assignment for yield return*/; } } } } }
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 override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe) { for (int j = 0; j < recipe.appliedOnFixedBodyParts.Count; j++) { BodyPartDef recipePart = recipe.appliedOnFixedBodyParts[j]; List <BodyPartRecord> bpList = pawn.RaceProps.body.AllParts; for (int i = 0; i < bpList.Count; i++) { _003CGetPartsToApplyOn_003Ec__Iterator0 _003CGetPartsToApplyOn_003Ec__Iterator = (_003CGetPartsToApplyOn_003Ec__Iterator0) /*Error near IL_0081: stateMachine*/; BodyPartRecord record = bpList[i]; if (record.def == recipePart && pawn.health.hediffSet.hediffs.Any((Hediff x) => x.Part == record) && (record.parent == null || pawn.health.hediffSet.GetNotMissingParts(BodyPartHeight.Undefined, BodyPartDepth.Undefined).Contains(record.parent)) && (!pawn.health.hediffSet.PartOrAnyAncestorHasDirectlyAddedParts(record) || pawn.health.hediffSet.HasDirectlyAddedPartFor(record))) { yield return(record); /*Error: Unable to find new state assignment for yield return*/; } } } }