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

21 lines
588 B
C#

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) {
if (CompBodyAnimator.IsAnimating(___pawn)) {
CompBodyAnimator bodyAnim = ___pawn.TryGetComp<CompBodyAnimator>();
__result = bodyAnim.anchor + bodyAnim.deltaPos;
return false;
}
return true;
}
}
}