coffees-rjw-ideology-addons/CRIALactation/Source/HarmonyPatches/HarmonyPatch_Thing.cs
2022-06-03 20:13:18 -07:00

26 lines
725 B
C#

using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using RimWorld;
namespace CRIALactation
{
[HarmonyPatch(typeof(Thing), "Ingested")]
public static class HarmonyPatch_Thing
{
public static void Prefix(Thing __instance, Pawn ingester)
{
if(__instance?.def == ThingDefOf_Milk.HumanMilk || __instance?.def == ThingDefOf_Milk.HumanoidMilk)
{
if (ingester.TryGetComp<CompInduceLactation>() == null) return;
ingester.TryGetComp<CompInduceLactation>().lastHumanLactationIngestedTick = Find.TickManager.TicksGame;
}
}
}
}