diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index a907d23..3aa8e1c 100644 Binary files a/1.1/Assemblies/Rimworld-Animations.dll and b/1.1/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/Patches/HarmonyPatch_Pawn_DrawTracker.cs b/Source/Patches/HarmonyPatch_Pawn_DrawTracker.cs index 863a3db..45a5886 100644 --- a/Source/Patches/HarmonyPatch_Pawn_DrawTracker.cs +++ b/Source/Patches/HarmonyPatch_Pawn_DrawTracker.cs @@ -13,12 +13,19 @@ namespace Rimworld_Animations { public static class HarmonyPatch_Pawn_DrawTracker { public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) { - if(___pawn.TryGetComp() != null && ___pawn.TryGetComp().isAnimating) { + CompBodyAnimator bodyAnim = ___pawn.TryGetComp(); + + if (bodyAnim != null && bodyAnim.isAnimating) { __result = ___pawn.TryGetComp().anchor + ___pawn.TryGetComp().deltaPos; + + if (bodyAnim.CurrentAnimation?.actors[bodyAnim.ActorIndex]?.offsetsByDefName != null && bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName.ContainsKey(___pawn.def.defName)) { + __result.x += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].x; + __result.z += bodyAnim.CurrentAnimation.actors[bodyAnim.ActorIndex].offsetsByDefName[___pawn.def.defName].y; + } + return false; } return true; - } } }