diff --git a/1.5/Assemblies/RJW_Menstruation.dll b/1.5/Assemblies/RJW_Menstruation.dll index 1ef21f7..84270e6 100644 Binary files a/1.5/Assemblies/RJW_Menstruation.dll and b/1.5/Assemblies/RJW_Menstruation.dll differ diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs index 9b9bdad..324ff39 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs @@ -97,53 +97,39 @@ namespace RJW_Menstruation bool IsAndroidmother = AndroidsCompatibility.IsAndroid(mother); bool IsAndroidfather = AndroidsCompatibility.IsAndroid(father); - if (IsAndroidmother && !IsAndroidfather) - { - spawn_kind_def = fatherKindDef; - } - else if (!IsAndroidmother && IsAndroidfather) - { - spawn_kind_def = motherKindDef; - } + if (IsAndroidmother != IsAndroidfather) + spawn_kind_def = IsAndroidmother ? fatherKindDef : motherKindDef; - string MotherRaceName = ""; - string FatherRaceName = ""; - MotherRaceName = motherKindDef?.race?.defName; - PawnKindDef non_hybrid_kind_def = spawn_kind_def; - if (father != null) - FatherRaceName = fatherKindDef?.race?.defName; + string MotherRaceName = motherKindDef?.race?.defName; + string FatherRaceName = fatherKindDef?.race?.defName; - - if (FatherRaceName != "" && Configurations.UseHybridExtention) + if (MotherRaceName != FatherRaceName && !FatherRaceName.NullOrEmpty()) { - spawn_kind_def = GetHybrid(father, mother); - //Log.Message("pawnkind: " + spawn_kind_def?.defName); - } - - if (MotherRaceName != FatherRaceName && FatherRaceName != "") - { - if (!Configurations.UseHybridExtention || spawn_kind_def == null) + PawnKindDef hybridPawnKind = Configurations.UseHybridExtention ? GetHybrid(father, mother) : null; + if (hybridPawnKind != null) + { + spawn_kind_def = hybridPawnKind; + } + else { - spawn_kind_def = non_hybrid_kind_def; IEnumerable groups = DefDatabase.AllDefs.Where(x => !(x.hybridRaceParents.NullOrEmpty() || x.hybridChildKindDef.NullOrEmpty())); - //ModLog.Message(" found custom RaceGroupDefs " + groups.Count()); - foreach (RaceGroupDef t in groups) + foreach (RaceGroupDef def in groups) { - if ((t.hybridRaceParents.Contains(MotherRaceName) && t.hybridRaceParents.Contains(FatherRaceName)) - || (t.hybridRaceParents.Contains("Any") && (t.hybridRaceParents.Contains(MotherRaceName) || t.hybridRaceParents.Contains(FatherRaceName)))) + if ((def.hybridRaceParents.Contains(MotherRaceName) && def.hybridRaceParents.Contains(FatherRaceName)) + || (def.hybridRaceParents.Contains("Any") && (def.hybridRaceParents.Contains(MotherRaceName) || def.hybridRaceParents.Contains(FatherRaceName)))) { //ModLog.Message(" has hybridRaceParents"); - if (t.hybridChildKindDef.Contains("MotherKindDef")) + if (def.hybridChildKindDef.Contains("MotherKindDef")) spawn_kind_def = motherKindDef; - else if (t.hybridChildKindDef.Contains("FatherKindDef") && father != null) + else if (def.hybridChildKindDef.Contains("FatherKindDef") && father != null) spawn_kind_def = fatherKindDef; else { //ModLog.Message(" trying hybridChildKindDef " + t.defName); List child_kind_def_list = new List(); - child_kind_def_list.AddRange(DefDatabase.AllDefs.Where(x => t.hybridChildKindDef.Contains(x.defName))); + child_kind_def_list.AddRange(DefDatabase.AllDefs.Where(x => def.hybridChildKindDef.Contains(x.defName))); //ModLog.Message(" found custom hybridChildKindDefs " + t.hybridChildKindDef.Count); if (!child_kind_def_list.NullOrEmpty()) @@ -152,12 +138,10 @@ namespace RJW_Menstruation } } } + } - } - else if (!Configurations.UseHybridExtention || spawn_kind_def == null) - { + if (spawn_kind_def == null) spawn_kind_def = mother.RaceProps?.AnyPawnKind ?? motherKindDef; - } if (spawn_kind_def.defName.Contains("Nymph")) {