Dead pawns don't get hediff ticks

This commit is contained in:
lutepickle 2022-08-23 08:08:25 -07:00
parent 4fc1d6b4ab
commit d9dc79f107
2 changed files with 7 additions and 7 deletions

View File

@ -166,8 +166,7 @@ namespace RJW_Menstruation
{ {
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !parent.pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns !parent.pawn.Spawned // TODO: Add option to simulate off-map pawns
parent.pawn.health.Dead
) )
{ {
return; return;

View File

@ -1,4 +1,5 @@
using RimWorld; using RimWorld;
using RimWorld.Planet;
using rjw; using rjw;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -560,7 +561,6 @@ namespace RJW_Menstruation
if ( if (
!parent.pawn.IsHashIntervalTick(tickInterval) || !parent.pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns !parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns
parent.pawn.health.Dead ||
(parent.pawn.IsAnimal() && !Configurations.EnableAnimalCycle) (parent.pawn.IsAnimal() && !Configurations.EnableAnimalCycle)
) )
{ {
@ -1120,10 +1120,11 @@ namespace RJW_Menstruation
public bool IsBreedingSeason() public bool IsBreedingSeason()
{ {
if (Props.breedingSeason == SeasonalBreed.Always) return true; if (Props.breedingSeason == SeasonalBreed.Always) return true;
Map map = parent.pawn.Map;
if (map == null) map = Find.AnyPlayerHomeMap; int tile = parent.pawn.Tile;
if (map == null) return true; if (tile < 0) tile = Find.AnyPlayerHomeMap?.Tile ?? -1;
switch (GenLocalDate.Season(map)) if (tile < 0) return true;
switch (GenLocalDate.Season(tile))
{ {
case Season.Spring: case Season.Spring:
return (Props.breedingSeason & SeasonalBreed.Spring) != 0; return (Props.breedingSeason & SeasonalBreed.Spring) != 0;