mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Switch opcache to a nullable
This commit is contained in:
parent
3cd1220283
commit
a0d0993560
1 changed files with 5 additions and 5 deletions
|
@ -125,7 +125,7 @@ namespace RJW_Menstruation
|
|||
protected bool estrusflag = false;
|
||||
protected float? ovulationChanceCache = null; // Dirtied every simulation
|
||||
protected float? implantationChanceCache = null;
|
||||
protected int opcache = -1;
|
||||
protected int? opcache = null;
|
||||
protected float antisperm = 0.0f;
|
||||
// RJW pregnancy, or Biotech pregnancy/labor/laborpushing
|
||||
protected Hediff pregnancy = null;
|
||||
|
@ -197,14 +197,14 @@ namespace RJW_Menstruation
|
|||
{
|
||||
get
|
||||
{
|
||||
if (opcache > 0) return opcache;
|
||||
if (opcache.HasValue) return opcache.Value;
|
||||
const float yearsBeforeMenopause = 6.0f;
|
||||
opcache = (int)(RaceCyclesPerYear() *
|
||||
AverageLitterSize() *
|
||||
yearsBeforeMenopause *
|
||||
(Pawn.RaceProps.lifeExpectancy / ThingDefOf.Human.race.lifeExpectancy));
|
||||
if (opcache == 0) opcache = 1;
|
||||
return opcache;
|
||||
if (opcache <= 0) opcache = 1;
|
||||
return opcache.Value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -655,7 +655,7 @@ namespace RJW_Menstruation
|
|||
estrusLevel = Props.concealedEstrus ? EstrusLevel.Concealed : EstrusLevel.Visible;
|
||||
ovulationFactor = 1f;
|
||||
noBleeding = false;
|
||||
opcache = -1;
|
||||
opcache = null;
|
||||
|
||||
if (Pawn.genes == null || !ModsConfig.BiotechActive) return;
|
||||
foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Where(gene => gene.Active).Select(gene => gene.def.GetModExtension<MenstruationModExtension>()).Where(ext => ext != null))
|
||||
|
|
Loading…
Reference in a new issue