mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Little refactor in CalculateLastBirth
This commit is contained in:
parent
4b6b4c87ee
commit
6701785462
1 changed files with 5 additions and 7 deletions
|
@ -3,6 +3,7 @@ using RimWorld;
|
||||||
using rjw;
|
using rjw;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Verse;
|
using Verse;
|
||||||
|
|
||||||
|
@ -187,15 +188,12 @@ namespace RJW_Menstruation
|
||||||
foreach (Pawn child in parent.pawn.relations.Children)
|
foreach (Pawn child in parent.pawn.relations.Children)
|
||||||
{
|
{
|
||||||
bool isFetus = false;
|
bool isFetus = false;
|
||||||
foreach (Hediff_BasePregnancy preg in parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>())
|
if (parent.pawn.health.hediffSet.GetHediffs<Hediff_BasePregnancy>().Any(preg => preg.babies.Contains(child)))
|
||||||
{
|
{
|
||||||
if (preg.babies.Contains(child))
|
isFetus = true;
|
||||||
{
|
break;
|
||||||
isFetus = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth &&
|
parent.pawn.ageTracker.BirthAbsTicks - child.ageTracker.BirthAbsTicks > ageOfLastBirth &&
|
||||||
!isFetus &&
|
!isFetus &&
|
||||||
|
|
Loading…
Reference in a new issue