mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Use OfType in places where it'd be useful
This commit is contained in:
parent
7f6309466a
commit
3cd1220283
2 changed files with 3 additions and 3 deletions
|
@ -971,7 +971,7 @@ namespace RJW_Menstruation
|
||||||
if (Pawn.HasIUD()) antisperm = 0.70f + asafactor;
|
if (Pawn.HasIUD()) antisperm = 0.70f + asafactor;
|
||||||
else antisperm = 0.0f + asafactor;
|
else antisperm = 0.0f + asafactor;
|
||||||
|
|
||||||
absorber = (Absorber)Pawn.apparel?.WornApparel.Find(x => x is Absorber);
|
absorber = Pawn.apparel?.WornApparel.OfType<Absorber>().FirstOrDefault();
|
||||||
if (absorber != null)
|
if (absorber != null)
|
||||||
{
|
{
|
||||||
absorber.WearEffect(TickInterval);
|
absorber.WearEffect(TickInterval);
|
||||||
|
|
|
@ -43,14 +43,14 @@ namespace RJW_Menstruation
|
||||||
switch (parent)
|
switch (parent)
|
||||||
{
|
{
|
||||||
case Hediff_Pregnant hediff_Pregnant:
|
case Hediff_Pregnant hediff_Pregnant:
|
||||||
Hediff_Labor labor = (Hediff_Labor)Pawn.health.hediffSet.hediffs.Where(hediff => hediff is Hediff_Labor).MaxByWithFallback(hediff => hediff.loadID);
|
Hediff_Labor labor = Pawn.health.hediffSet.hediffs.OfType<Hediff_Labor>().MaxByWithFallback(hediff => hediff.loadID);
|
||||||
HediffComp_PregeneratedBabies laborcomp = labor?.TryGetComp<HediffComp_PregeneratedBabies>();
|
HediffComp_PregeneratedBabies laborcomp = labor?.TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
if (laborcomp == null) return;
|
if (laborcomp == null) return;
|
||||||
laborcomp.babies = this.babies;
|
laborcomp.babies = this.babies;
|
||||||
laborcomp.enzygoticSiblings = this.enzygoticSiblings;
|
laborcomp.enzygoticSiblings = this.enzygoticSiblings;
|
||||||
break;
|
break;
|
||||||
case Hediff_Labor hediff_Labor:
|
case Hediff_Labor hediff_Labor:
|
||||||
Hediff_LaborPushing pushing = (Hediff_LaborPushing)Pawn.health.hediffSet.hediffs.Where(hediff => hediff is Hediff_LaborPushing).MaxByWithFallback(hediff => hediff.loadID);
|
Hediff_LaborPushing pushing = Pawn.health.hediffSet.hediffs.OfType<Hediff_LaborPushing>().MaxByWithFallback(hediff => hediff.loadID);
|
||||||
HediffComp_PregeneratedBabies pushingcomp = pushing?.TryGetComp<HediffComp_PregeneratedBabies>();
|
HediffComp_PregeneratedBabies pushingcomp = pushing?.TryGetComp<HediffComp_PregeneratedBabies>();
|
||||||
if (pushingcomp == null) return;
|
if (pushingcomp == null) return;
|
||||||
pushingcomp.babies = this.babies;
|
pushingcomp.babies = this.babies;
|
||||||
|
|
Loading…
Reference in a new issue