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 (
!parent.pawn.IsHashIntervalTick(tickInterval) ||
!parent.pawn.Spawned || // TODO: Add option to simulate off-map pawns
parent.pawn.health.Dead
!parent.pawn.Spawned // TODO: Add option to simulate off-map pawns
)
{
return;

View file

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