Some input sanitization for the egg life span and ovulation genes
This commit is contained in:
parent
fcbc19825e
commit
02b0045fb3
|
@ -680,8 +680,7 @@ namespace RJW_Menstruation
|
|||
noBleeding = false;
|
||||
opcache = -1;
|
||||
|
||||
if (Pawn.genes == null || !ModsConfig.BiotechActive) return;
|
||||
|
||||
if (Pawn.genes == null || !ModsConfig.BiotechActive) return;
|
||||
foreach (MenstruationModExtension extension in Pawn.genes.GenesListForReading.Select(gene => gene.def.GetModExtension<MenstruationModExtension>()))
|
||||
{
|
||||
if (extension == null) continue;
|
||||
|
@ -692,6 +691,8 @@ namespace RJW_Menstruation
|
|||
ovulationFactor *= extension.ovulationFactor;
|
||||
if (extension.noBleeding) noBleeding = true;
|
||||
}
|
||||
if (eggLifeSpanTicks < 0) eggLifeSpanTicks = 0;
|
||||
if (ovulationFactor < 0f) ovulationFactor = 0f;
|
||||
}
|
||||
|
||||
public bool ShouldSimulate()
|
||||
|
|
Loading…
Reference in New Issue