rimworld-animations/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs
Platinum d43eb0d4f9 bugfix: null ref exceptions for masturbate, corpse
todo: allow anims for masturbate and corpse?
2020-04-18 18:52:59 -07:00

26 lines
766 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
using rjw;
using Verse.AI;
namespace Rimworld_Animations {
[HarmonyPatch(typeof(JobGiver_DoLovin), "TryGiveJob")]
public static class HarmonyPatch_DoLovinAnimationPatch {
public static void Postfix(ref Pawn pawn, ref Job __result) {
if(__result != null) {
Pawn partnerInMyBed = LovePartnerRelationUtility.GetPartnerInMyBed(pawn);
RestUtility.WakeUp(pawn);
__result = JobMaker.MakeJob(DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true), partnerInMyBed, partnerInMyBed.CurrentBed());
}
}
}
}