public bool AncestorIsImplant(BodyPartRecord record, CustomPawn pawn) { foreach (BodyPartRecord ancestor in bodyPartAncestors[record]) { if (pawn.IsImplantedPart(ancestor)) { return(true); } } return(false); }
protected void ResetBodyPartEnabledState(IEnumerable <BodyPartRecord> parts, CustomPawn pawn) { disabledBodyParts.Clear(); ImplantManager implantManager = PrepareCarefully.Instance.HealthManager.ImplantManager; foreach (var part in parts) { if (pawn.IsImplantedPart(part) || implantManager.AncestorIsImplant(pawn, part)) { disabledBodyParts.Add(part); } } }