public IEnumerable <BodyPartRecord> GetConnectedParts(string tag) { BodyPartRecord ancestor = this; while (ancestor.parent != null && ancestor.parent.def.tags.Contains(tag)) { ancestor = ancestor.parent; } foreach (BodyPartRecord child in ancestor.GetChildParts(tag)) { yield return(child); } }
public IEnumerable <BodyPartRecord> GetConnectedParts(BodyPartTagDef tag) { BodyPartRecord bodyPartRecord = this; while (bodyPartRecord.parent != null && bodyPartRecord.parent.def.tags.Contains(tag)) { bodyPartRecord = bodyPartRecord.parent; } foreach (BodyPartRecord childPart in bodyPartRecord.GetChildParts(tag)) { yield return(childPart); } }
public IEnumerable <BodyPartRecord> GetConnectedParts(string tag) { BodyPartRecord ancestor = this; while (ancestor.parent != null && ancestor.parent.def.tags.Contains(tag)) { ancestor = ancestor.parent; } using (IEnumerator <BodyPartRecord> enumerator = ancestor.GetChildParts(tag).GetEnumerator()) { if (enumerator.MoveNext()) { BodyPartRecord child = enumerator.Current; yield return(child); /*Error: Unable to find new state assignment for yield return*/; } } yield break; IL_0116: /*Error near IL_0117: Unexpected return in MoveNext()*/; }