Little refactor to ovulation egging

This commit is contained in:
lutepickle 2022-09-08 16:00:48 -07:00
parent 7f306fb9c7
commit c081e1e9b9

View file

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