2022-06-25 16:23:11 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using rjw;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
|
2022-07-13 13:08:16 +00:00
|
|
|
|
namespace rjwstd
|
2022-06-25 16:23:11 +00:00
|
|
|
|
{
|
|
|
|
|
///<summary>
|
|
|
|
|
///roll for STD update every 10 sex need ticks
|
|
|
|
|
///</summary>
|
|
|
|
|
[HarmonyPatch(typeof(PawnGenerator), "GeneratePawn", new Type[] { typeof(PawnGenerationRequest)})]
|
|
|
|
|
[StaticConstructorOnStartup]
|
|
|
|
|
static class PawnGenerator_STD_spreader
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPostfix]
|
|
|
|
|
private static void PawnGenerator_STD_spreader_Patch(ref PawnGenerationRequest request, ref Pawn __result)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!request.Newborn)
|
|
|
|
|
if (__result != null)
|
|
|
|
|
std_spreader.generate_on(__result);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Log.Error(e.ToString());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|