diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 6c71669..3ffb81f 100644 Binary files a/1.1/Assemblies/Rimworld-Animations.dll and b/1.1/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index 1dc58c5..9524e20 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -118,7 +118,7 @@ namespace Rimworld_Animations { tickAnim(); if (pawn?.jobs?.curDriver == null || (pawn?.jobs?.curDriver != null && !(pawn?.jobs?.curDriver is rjw.JobDriver_Sex))) { - Animating = false; + isAnimating = false; } } } diff --git a/Source/Patches/HarmonyPatch_FacialAnimation.cs b/Source/Patches/HarmonyPatch_FacialAnimation.cs index 9ebe1aa..0f840b8 100644 --- a/Source/Patches/HarmonyPatch_FacialAnimation.cs +++ b/Source/Patches/HarmonyPatch_FacialAnimation.cs @@ -31,7 +31,7 @@ namespace Rimworld_Animations { CompBodyAnimator bodyAnim = ___pawn.TryGetComp(); - if (bodyAnim.isAnimating && !portrait) { + if (bodyAnim != null && bodyAnim.isAnimating && !portrait) { headFacing = bodyAnim.headFacing; headOrigin = new Vector3(bodyAnim.getPawnHeadPosition().x, headOrigin.y, bodyAnim.getPawnHeadPosition().z); diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index 14f6402..d3e0f6f 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -68,12 +68,18 @@ namespace Rimworld_Animations { Log.Message("Now playing " + anim.defName); bool mirror = GenTicks.TicksGame % 2 == 0; + + IntVec3 pos = pawn.Position; + for (int i = 0; i < pawnsToAnimate.Count; i++) { if (bed != null) pawnsToAnimate[i].TryGetComp().setAnchor(bed); - else - pawnsToAnimate[i].TryGetComp().setAnchor(pawn); + else { + + pawnsToAnimate[i].TryGetComp().setAnchor(pos); + } + pawnsToAnimate[i].TryGetComp().StartAnimation(anim, i, mirror); (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_left = anim.animationTimeTicks; @@ -112,11 +118,6 @@ namespace Rimworld_Animations { if (!((parteners[i].jobs.curDriver as JobDriver_SexBaseInitiator) != null && (parteners[i].jobs.curDriver as JobDriver_SexBaseInitiator).Target != __instance.pawn)) parteners[i].TryGetComp().isAnimating = false; - if (xxx.is_human(parteners[i])) { - parteners[i].Drawer.renderer.graphics.ResolveApparelGraphics(); - PortraitsCache.SetDirty(parteners[i]); - } - } __instance.Target.TryGetComp().isAnimating = false;