Encapsulate calculatingOvulationChance
This commit is contained in:
parent
924dc73024
commit
ff22e534d1
|
@ -296,7 +296,8 @@ namespace RJW_Menstruation
|
||||||
}
|
}
|
||||||
|
|
||||||
// I hate doing this, but it's the least bad option
|
// I hate doing this, but it's the least bad option
|
||||||
public bool calculatingOvulationChance = false;
|
private bool calculatingOvulationChance = false;
|
||||||
|
public bool CalculatingOvulationChance { get => calculatingOvulationChance; }
|
||||||
|
|
||||||
protected float CalcuatedOvulationChance()
|
protected float CalcuatedOvulationChance()
|
||||||
{
|
{
|
||||||
|
|
|
@ -378,7 +378,7 @@ namespace RJW_Menstruation
|
||||||
private static float GetFertilityStatOrOne(Thing thing, StatDef stat, bool applyPostProcess, int cacheStaleAfterTicks)
|
private static float GetFertilityStatOrOne(Thing thing, StatDef stat, bool applyPostProcess, int cacheStaleAfterTicks)
|
||||||
{
|
{
|
||||||
Pawn pawn = (Pawn)thing;
|
Pawn pawn = (Pawn)thing;
|
||||||
if (pawn.GetMenstruationComps().Any(comp => comp.calculatingOvulationChance))
|
if (pawn.GetMenstruationComps().Any(comp => comp.CalculatingOvulationChance))
|
||||||
return 1.0f;
|
return 1.0f;
|
||||||
else return thing.GetStatValue(stat, applyPostProcess, cacheStaleAfterTicks);
|
else return thing.GetStatValue(stat, applyPostProcess, cacheStaleAfterTicks);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue