diff --git a/Source/Harmony/patch_lovin.cs b/Source/Harmony/patch_lovin.cs index 452efba4fe738dadf952e838ba210fa2ccd83d69..0d5c98c4952b16ff6f5cf29d461985e8b8b606de 100644 --- a/Source/Harmony/patch_lovin.cs +++ b/Source/Harmony/patch_lovin.cs @@ -23,6 +23,20 @@ namespace rjw } } + [HarmonyPatch(typeof(JobDriver_Mate))] + [HarmonyPatch("MakeNewToils")] + internal static class PATCH_JobDriver_Mate_MakeNewToils + { + [HarmonyPrefix] + private static bool on_begin_lovin(JobDriver_Mate __instance) + { + //--Log.Message("[RJW]patches_lovin::PATCH_JobDriver_Mate_MakeNewToils is called"); + //if (__instance == null) return true; + __instance.FailOn(() => (!(xxx.can_fuck(__instance.pawn) || xxx.can_be_fucked(__instance.pawn)))); + return true; + } + } + //JobDriver_DoLovinCasual from RomanceDiversified should have handled whether pawns can do casual lovin, //so I don't bothered to do a check here, unless some bugs occur due to this. @@ -43,6 +57,9 @@ namespace rjw //vanilla lovin private readonly static Type JobDriverLovin = typeof(JobDriver_Lovin); + //vanilla mate + private readonly static Type JobDriverMate = typeof(JobDriver_Mate); + [HarmonyPrefix] private static bool on_cleanup_driver(JobDriver __instance, JobCondition condition) { @@ -77,6 +94,10 @@ namespace rjw PregnancyHelper.cleanup_CnP(partner); } } + //Vanilla mating + else if (__instance.GetType() == JobDriverMate) + { + } else return true;