Hardened Utility to account for childs with in-active lifeforce

This commit is contained in:
Vegapnk 2023-03-10 08:03:07 +01:00
parent 999236768e
commit 1b590ba2a2
2 changed files with 30 additions and 3 deletions

View file

@ -42,7 +42,7 @@ namespace RJW_Genes
{
Pawn_GeneTracker genes = pawn.genes;
Gene_LifeForce gene_Lifeforce = (genes != null) ? genes.GetFirstGeneOfType<Gene_LifeForce>() : null;
if (gene_Lifeforce != null && gene_Lifeforce.Value < gene_Lifeforce.MinLevelForAlert)
if (gene_Lifeforce != null && gene_Lifeforce.Active && gene_Lifeforce.Value < gene_Lifeforce.MinLevelForAlert)
{
this.targets.Add(pawn);
this.targetLabels.Add(pawn.NameShortColored.Resolve());