Start new animation for neverendingsex
This commit is contained in:
parent
41b5411c73
commit
138ac25019
Binary file not shown.
|
@ -24,4 +24,30 @@ namespace Rimworld_Animations
|
|||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(JobDriver_Sex), "SexTick")]
|
||||
public class HarmonyPatch_JobDriver_Sex2
|
||||
{
|
||||
public static void Postfix(JobDriver_Sex __instance, Pawn pawn)
|
||||
{
|
||||
//if neverending sex and pawn doesn't have an animation,
|
||||
if (__instance.neverendingsex
|
||||
&& __instance is JobDriver_SexBaseReciever receiverJobDriver
|
||||
&& !pawn.TryGetComp<CompExtendedAnimator>().IsAnimating)
|
||||
{
|
||||
|
||||
//start a new animation for all the pawns paired with receiver job driver
|
||||
List<Pawn> participants = receiverJobDriver.parteners.Append(pawn).ToList();
|
||||
GroupAnimationDef animation = AnimationUtility.FindGroupAnimation(participants, out int reorder);
|
||||
if (animation != null)
|
||||
{
|
||||
Thing anchor = (Thing)__instance.Bed ?? pawn;
|
||||
AnimationUtility.StartGroupAnimation(participants, animation, reorder, anchor);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -48,8 +48,6 @@ namespace Rimworld_Animations {
|
|||
participantJobDriver.orgasmStartTick = animTicks;
|
||||
participantJobDriver.duration = animTicks;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue