diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index d4d7bb3..97337d7 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index e86422d..d015752 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1037,7 +1037,7 @@ namespace RJW_Menstruation if (TotalCum > Props.maxCumCapacity * Pawn.BodySize) leakfactor = Math.Min(1 + (TotalCum - Props.maxCumCapacity * Pawn.BodySize) / 10, 2f); if (absorber != null && absorber.dirty && !absorber.LeakAfterDirty) leakfactor = 0f; if (Pawn.CurJobDef == xxx.knotted) leakfactor = 0f; - List removecums = new List(); + HashSet removecums = new HashSet(); foreach (Cum cum in cums) { cum.CumEffects(Pawn); @@ -1050,10 +1050,7 @@ namespace RJW_Menstruation } if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels); else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak); - foreach (Cum cum in removecums) - { - cums.Remove(cum); - } + cums.RemoveAll(cum => removecums.Contains(cum)); cumd = TotalCumPercent - cumd; if (totalleak >= 1.0f) AfterCumOut(); AfterFluidOut(cumd); @@ -1073,7 +1070,7 @@ namespace RJW_Menstruation List filthlabels = new List(); float outcum = 0; float cumd = TotalCumPercent; - List removecums = new List(); + HashSet removecums = new HashSet(); foreach (Cum cum in cums) { float vd = cum.DismishForce(portion); @@ -1086,10 +1083,7 @@ namespace RJW_Menstruation } if (cums.Count > 1) MakeCumFilthMixture(totalleak, filthlabels); else if (cums.Count == 1) MakeCumFilth(cums.First(), totalleak); - foreach (Cum cum in removecums) - { - cums.Remove(cum); - } + cums.RemoveAll(cum => removecums.Contains(cum)); cumd = TotalCumPercent - cumd; AfterFluidOut(cumd); return outcum; @@ -1107,7 +1101,7 @@ namespace RJW_Menstruation Color color = GetCumMixtureColor; float totalleak = 0; List cumlabels = new List(); - List removecums = new List(); + HashSet removecums = new HashSet(); bool pure = true; foreach (Cum cum in cums) { @@ -1118,10 +1112,7 @@ namespace RJW_Menstruation if (cum.ShouldRemove()) removecums.Add(cum); if (cum.notcum) pure = false; } - foreach (Cum cum in removecums) - { - cums.Remove(cum); - } + cums.RemoveAll(cum => removecums.Contains(cum)); return new CumMixture(Pawn, totalleak, cumlabels, color, mixtureDef, pure); } @@ -1364,7 +1355,7 @@ namespace RJW_Menstruation { if (eggs.NullOrEmpty()) return false; - List deadeggs = new List(); + HashSet deadeggs = new HashSet(); bool pregnant = false; foreach (Egg egg in eggs) { @@ -1457,9 +1448,7 @@ namespace RJW_Menstruation rjw_preg.p_start_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour; rjw_preg.p_end_tick -= egg.fertstage / Configurations.CycleAcceleration * GenDate.TicksPerHour; } - if (!(pregnancy is Hediff_MultiplePregnancy)) break; } - } else { @@ -1476,12 +1465,7 @@ namespace RJW_Menstruation return true; } else - { - foreach (Egg egg in deadeggs) - { - eggs.Remove(egg); - } - } + eggs.RemoveAll(egg => deadeggs.Contains(egg)); return pregnant; } @@ -1551,7 +1535,7 @@ namespace RJW_Menstruation protected void EggDecay() { - List deadeggs = new List(); + HashSet deadeggs = new HashSet(); foreach (Egg egg in eggs) { egg.position += Configurations.CycleAcceleration; @@ -1562,10 +1546,7 @@ namespace RJW_Menstruation if (egg.lifespanhrs < 0) deadeggs.Add(egg); } } - foreach (Egg egg in deadeggs) - { - eggs.Remove(egg); - } + eggs.RemoveAll(egg => deadeggs.Contains(egg)); } protected void AddCrampPain() @@ -1629,7 +1610,7 @@ namespace RJW_Menstruation eggs.Add(new Egg((int)(EggLifespanHours / CycleFactor))); ++ovulated; } - if(ovulated < ovarypower) ovulated = Math.Max(ovarypower, eggstack); + if(ovulated > ovarypower) ovulated = Math.Min(ovarypower, eggstack); ovarypower -= ovulated; eggstack = 0; diff --git a/About/Manifest.xml b/About/Manifest.xml index 24b2e46..fc6edef 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.8.8 + 1.0.8.9 diff --git a/changelogs.txt b/changelogs.txt index 4647b8e..f68bbbe 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,6 @@ +Version 1.0.8.9 + - Fix bug that sent pawns into menopause very early. Please use the recalculate ovary power dev action to restore lost eggs. + Version 1.0.8.8 - Fix pawns skipping straight to menopause instead of going through climacteric stages. - Fix father appearing as "Null" in womb dialog for some Biotech pregnancies.