diff --git a/1.3/Assemblies/Rimworld-Animations.dll b/1.3/Assemblies/Rimworld-Animations.dll index fff7328..0fbbebf 100644 Binary files a/1.3/Assemblies/Rimworld-Animations.dll and b/1.3/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/AnimationUtility.cs b/Source/AnimationUtility.cs index ca284e7..961047c 100644 --- a/Source/AnimationUtility.cs +++ b/Source/AnimationUtility.cs @@ -279,6 +279,8 @@ namespace Rimworld_Animations { public static Rot4 PawnHeadRotInAnimation(Pawn pawn, Rot4 regularPos) { + Debug.Log("Test"); + if(pawn?.TryGetComp() != null && pawn.TryGetComp().isAnimating) { return pawn.TryGetComp().headFacing; diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index 8ce0aca..2cacaf7 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -32,6 +32,7 @@ namespace Rimworld_Animations { actorsInCurrentAnimation = null; } + PortraitsCache.SetDirty(pawn); } } private bool Animating = false; diff --git a/Source/Patches/HarmonyPatch_PawnRenderer.cs b/Source/Patches/HarmonyPatch_PawnRenderer.cs index 6e31a1d..d225b6a 100644 --- a/Source/Patches/HarmonyPatch_PawnRenderer.cs +++ b/Source/Patches/HarmonyPatch_PawnRenderer.cs @@ -46,9 +46,6 @@ namespace Rimworld_Animations { foreach (CodeInstruction i in instructions) { - - - if (i.opcode == OpCodes.Ldfld && i.OperandIs(AccessTools.Field(typeof(PawnGraphicSet), "headGraphic"))) { @@ -57,13 +54,14 @@ namespace Rimworld_Animations { yield return i; } - else if (forHead && i.operand == (object)7) + else if (forHead && i.opcode == OpCodes.Ldarg_S && i.operand == (object)4) { yield return new CodeInstruction(OpCodes.Ldarg_0); yield return new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(PawnRenderer), "pawn")); - yield return new CodeInstruction(OpCodes.Ldloc_S, operand: 7); + yield return new CodeInstruction(OpCodes.Ldloc_S, operand: 4); yield return new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(AnimationUtility), "PawnHeadRotInAnimation")); + } else diff --git a/Source/Patches/HarmonyPatch_PawnRotation.cs b/Source/Patches/HarmonyPatch_PawnRotation.cs index d09b1f6..7ec75a1 100644 --- a/Source/Patches/HarmonyPatch_PawnRotation.cs +++ b/Source/Patches/HarmonyPatch_PawnRotation.cs @@ -26,24 +26,4 @@ namespace Rimworld_Animations { } - [HarmonyPatch(typeof(PawnRenderer), "BodyAngle")] - public static class HarmonyPatch_PawnAngle - { - public static bool Prefix(Pawn ___pawn, ref float __result) - { - - if(___pawn.TryGetComp().isAnimating) - { - __result = ___pawn.TryGetComp().bodyAngle; - return false; - } - - return true; - - } - } - - - - }