mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
24 lines
587 B
C#
24 lines
587 B
C#
|
using HarmonyLib;
|
|||
|
using System.Linq;
|
|||
|
using Verse;
|
|||
|
|
|||
|
namespace RJW_Genes.Genes
|
|||
|
{
|
|||
|
[HarmonyPatch]
|
|||
|
public static class Patch_AddNotifyOnGeneration
|
|||
|
{
|
|||
|
[HarmonyPatch(typeof(PawnGenerator), "GenerateGenes")]
|
|||
|
[HarmonyPostfix]
|
|||
|
public static void PawnGenerator_GenerateGenes_Postfix(Pawn pawn)
|
|||
|
{
|
|||
|
if (pawn.genes == null) return;
|
|||
|
|
|||
|
foreach(var gene in pawn.genes.GenesListForReading)
|
|||
|
{
|
|||
|
if (gene is RJW_Gene rjwGene)
|
|||
|
rjwGene.Notify_OnPawnGeneration();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|