Fix null fertilizer when an egg tries to implant

This commit is contained in:
lutepickle 2022-06-16 17:57:52 -07:00
parent 1ef735f328
commit 204fe0ecc7
3 changed files with 7 additions and 2 deletions

Binary file not shown.

View file

@ -1159,6 +1159,11 @@ namespace RJW_Menstruation
foreach (Egg egg in eggs) foreach (Egg egg in eggs)
{ {
if (!egg.fertilized || egg.fertstage < 168) continue; if (!egg.fertilized || egg.fertstage < 168) continue;
else if (egg.fertilizer is null)
{
deadeggs.Add(egg);
continue;
}
else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer)) else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantFactor * InterspeciesImplantFactor(egg.fertilizer))
{ {
Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy(); Hediff_BasePregnancy pregnancy = parent.pawn.GetRJWPregnancy();

View file

@ -1,6 +1,6 @@
Version 1.0.6.6 Version 1.0.6.6
- The menstruation cycle used to start ticking exactly one game hour after loading the save. Now the hour timing is consistent across a save/load. - The womb tick timing is now more consistent across a save and load, and also spread out across pawns.
- Every womb will tick at a different (but consistent) time after the hour per pawn. - Fix error when an egg fertilized by a nonexistent/garbage collected pawn (e.g. in an NPC's womb) tries to implant.
Version 1.0.6.5 Version 1.0.6.5
- Handle climacteric induced ovulators a bit better. - Handle climacteric induced ovulators a bit better.