diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index ffb4296..cdf9afd 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1013,7 +1013,7 @@ namespace RJW_Menstruation float leakfactor = 1.0f; float totalleak = 0f; float cumd = TotalCumPercent; - List filthlabels = new List(cums.Count); + List filthlabels = new List(); BeforeCumOut(out Absorber absorber); if (cums.NullOrEmpty()) return; if (TotalCum > Props.maxCumCapacity * Pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * Pawn.BodySize) / 10, 2f); @@ -1045,10 +1045,10 @@ namespace RJW_Menstruation { if (cums.NullOrEmpty()) return 0; float totalleak = 0; - List filthlabels = new List(cums.Count); + List filthlabels = new List(); float outcum = 0; float cumd = TotalCumPercent; - HashSet removecums = new HashSet(cums.Count); + HashSet removecums = new HashSet(); foreach (Cum cum in cums) { float vd = cum.DismishForce(portion); @@ -1079,8 +1079,8 @@ namespace RJW_Menstruation if (cums.NullOrEmpty()) return null; Color color = GetCumMixtureColor; float totalleak = 0; - List cumlabels = new List(cums.Count); - HashSet removecums = new HashSet(cums.Count); + List cumlabels = new List(); + HashSet removecums = new HashSet(); bool pure = true; foreach (Cum cum in cums) { @@ -1370,7 +1370,7 @@ namespace RJW_Menstruation { if (eggs.NullOrEmpty()) return false; - HashSet deadeggs = new HashSet(eggs.Count); + HashSet deadeggs = new HashSet(); bool pregnant = false; foreach (Egg egg in eggs) { @@ -1574,7 +1574,7 @@ namespace RJW_Menstruation protected void EggDecay() { - HashSet deadeggs = new HashSet(eggs.Count); + HashSet deadeggs = new HashSet(); foreach (Egg egg in eggs) { egg.ageTicks += TickInterval * Configurations.CycleAcceleration; diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index e58cfcf..1a96da8 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -87,10 +87,14 @@ namespace RJW_Menstruation PawnUtility.TrySpawnHatchedOrBornPawn(baby, mother); Need_Sex sex_need = mother.needs?.TryGetNeed(); + if (mother.Faction != null && !(mother.Faction?.IsPlayer ?? false) && sex_need != null) + { + sex_need.CurLevel = 1.0f; + } if (mother.Faction != null) { - if (!mother.Faction.IsPlayer && sex_need != null) sex_need.CurLevel = 1.0f; - if (mother.Faction != baby.Faction) baby.SetFaction(mother.Faction); + if (mother.Faction != baby.Faction) + baby.SetFaction(mother.Faction); } if (mother.IsSlaveOfColony) { @@ -145,10 +149,14 @@ namespace RJW_Menstruation PawnUtility.TrySpawnHatchedOrBornPawn(baby, mother); Need_Sex sex_need = mother.needs?.TryGetNeed(); + if (mother.Faction != null && !(mother.Faction?.IsPlayer ?? false) && sex_need != null) + { + sex_need.CurLevel = 1.0f; + } if (mother.Faction != null) { - if (!mother.Faction.IsPlayer && sex_need != null) sex_need.CurLevel = 1.0f; - if (mother.Faction != baby.Faction) baby.SetFaction(mother.Faction); + if (mother.Faction != baby.Faction) + baby.SetFaction(mother.Faction); } Train(baby, mother); diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs index 893a9cc..6221a81 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/PregnancyCommon.cs @@ -217,7 +217,7 @@ namespace RJW_Menstruation if (info != null) { - res = info.GetHybridWith(opposite.def.defName); + res = info.GetHybridWith(opposite.def.defName) ?? null; } if (res != null) return res; @@ -226,14 +226,14 @@ namespace RJW_Menstruation dna = first.def.GetModExtension(); if (dna != null) { - res = dna.GetHybridWith(second.def.defName); + res = dna.GetHybridWith(second.def.defName) ?? null; } else { dna = second.def.GetModExtension(); if (dna != null) { - res = dna.GetHybridWith(first.def.defName); + res = dna.GetHybridWith(first.def.defName) ?? null; } } return res; diff --git a/1.5/source/RJW_Menstruation/RJW_Menstruation/Things.cs b/1.5/source/RJW_Menstruation/RJW_Menstruation/Things.cs index d266480..8b110d7 100644 --- a/1.5/source/RJW_Menstruation/RJW_Menstruation/Things.cs +++ b/1.5/source/RJW_Menstruation/RJW_Menstruation/Things.cs @@ -25,7 +25,7 @@ namespace RJW_Menstruation public PawnKindDef GetHybridWith(string race) { - return GetHybridExtension(race)?.ChooseOne(); + return GetHybridExtension(race)?.ChooseOne() ?? null; } } @@ -128,7 +128,7 @@ namespace RJW_Menstruation public PawnKindDef GetHybridWith(string race) { - return GetHybridExtension(race)?.ChooseOne(); + return GetHybridExtension(race)?.ChooseOne() ?? null; } public void ExposeData()