Split ShouldSimulate into its own function

This commit is contained in:
lutepickle 2022-08-29 07:23:17 -07:00
parent e88e40c2cc
commit acfee52dd8
2 changed files with 18 additions and 3 deletions

View file

@ -158,6 +158,14 @@ namespace RJW_Menstruation
Scribe_Values.Look(ref baseNipple, "baseNipple", baseNipple, true);
}
public bool ShouldSimulate()
{
if (!Configurations.EnableAnimalCycle && Pawn.IsAnimal()) return false;
if (Pawn.Spawned) return true;
return false;
}
public override void CompPostTick(ref float severityAdjustment)
{
base.CompPostTick(ref severityAdjustment);
@ -166,7 +174,7 @@ namespace RJW_Menstruation
{
if (
!Pawn.IsHashIntervalTick(tickInterval) ||
!Pawn.Spawned // TODO: Add option to simulate off-map pawns
!ShouldSimulate()
)
{
return;

View file

@ -549,6 +549,14 @@ namespace RJW_Menstruation
}
}
public bool ShouldSimulate()
{
if (!Configurations.EnableAnimalCycle && Pawn.IsAnimal()) return false;
if (Pawn.Spawned) return true;
return false;
}
public override void CompPostTick(ref float severityAdjustment)
{
base.CompPostTick(ref severityAdjustment);
@ -557,8 +565,7 @@ namespace RJW_Menstruation
{
if (
!Pawn.IsHashIntervalTick(tickInterval) ||
!Pawn.Spawned || // TODO: Add option to simulate off-map pawns
(Pawn.IsAnimal() && !Configurations.EnableAnimalCycle)
!ShouldSimulate()
)
{
return;