Little refactor to ovulation egging

This commit is contained in:
lutepickle 2022-09-08 16:00:48 -07:00
parent 7f306fb9c7
commit c081e1e9b9
1 changed files with 5 additions and 8 deletions

View File

@ -1390,11 +1390,10 @@ namespace RJW_Menstruation
protected virtual void OvulatoryAction()
{
estrusflag = false;
int i = 0;
float eggnum;
int eggnum;
try
{
eggnum = Rand.ByCurve(Pawn.def.race.litterSizeCurve);
eggnum = Math.Min((int)Rand.ByCurve(Pawn.def.race.litterSizeCurve), 1);
}
catch (NullReferenceException)
{
@ -1407,12 +1406,10 @@ namespace RJW_Menstruation
}
eggnum += eggstack;
do
{
ovarypower--;
for (int i = 0; i < eggnum; i++)
eggs.Add(new Egg((int)(Props.eggLifespanDays * 24 / CycleFactor)));
i++;
} while (i < (int)eggnum);
ovarypower -= eggnum;
eggstack = 0;
if (EggHealth <= 0)
{