From 441ee1de48f8724dbc8b55badd5edd291303fbd6 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Sat, 28 Oct 2023 10:43:23 -0700 Subject: [PATCH] Refactor GoNextStage to directly take a stage time --- .../HediffComps/HediffComp_Menstruation.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 c4579be..267a42c 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 @@ -1734,8 +1734,7 @@ namespace RJW_Menstruation GoOvulatoryStage(); else { - currentIntervalTicks = totalFollicularTicks - currentIntervalTicks; // I.e., the remaining follicular time equals the total minus the bleeding time elapsed - GoNextStage(Stage.Follicular, false); + GoNextStage(Stage.Follicular, totalFollicularTicks - currentIntervalTicks); // I.e., the remaining follicular time equals the total minus the bleeding time elapsed } } else @@ -1800,7 +1799,7 @@ namespace RJW_Menstruation else { bool breedingSeason = IsBreedingSeason(); - GoNextStage(breedingSeason ? Stage.Follicular : Stage.Anestrus, breedingSeason); + GoNextStage(breedingSeason ? Stage.Follicular : Stage.Anestrus, breedingSeason ? (int?)null : 0); } } @@ -1875,10 +1874,10 @@ namespace RJW_Menstruation TaleRecorder.RecordTale(VariousDefOf.TaleCameInside, new object[] { cummer, Pawn }); } - public void GoNextStage(Stage nextstage, bool calculateHours = true) + public void GoNextStage(Stage nextstage, int? stageTicks = null) { curStageTicks = 0; - if (calculateHours) currentIntervalTicks = PeriodRandomizer(nextstage); + currentIntervalTicks = stageTicks ?? PeriodRandomizer(nextstage); curStage = nextstage; }