rimworld-animations/1.4/Source/Patches/RimworldPatches/HarmonyPatch_Pawn_DrawTrack...

21 lines
588 B
C#
Raw Normal View History

2022-10-05 20:50:02 +00:00
using HarmonyLib;
using UnityEngine;
using Verse;
namespace Rimworld_Animations {
[HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)]
public static class HarmonyPatch_Pawn_DrawTracker {
public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) {
2023-12-03 06:48:42 +00:00
if (CompBodyAnimator.IsAnimating(___pawn)) {
CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();
__result = bodyAnim.anchor + bodyAnim.deltaPos;
2022-10-05 20:50:02 +00:00
return false;
}
return true;
}
}
}