rimworld-animations/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderer.cs

33 lines
679 B
C#

using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace Rimworld_Animations
{
[HarmonyPatch(typeof(PawnRenderer), "BodyAngle")]
public class HarmonyPatch_PawnRenderer
{
public static bool Prefix(ref Pawn ___pawn, ref float __result)
{
//set body angle to zero, for when downed
if (___pawn?.Drawer?.renderer?.renderTree?.rootNode?.AnimationWorker is AnimationWorker_KeyframesExtended)
{
__result = 0;
return false;
}
return true;
}
}
}