addon rot fix

This commit is contained in:
c0ffee 2021-07-25 22:56:01 -07:00
parent 58b99e4dcf
commit 36caeeda7e
3 changed files with 18 additions and 3 deletions

View File

@ -108,6 +108,7 @@
<ItemGroup>
<Content Include="1.1\Assemblies\Rimworld-Animations.dll" />
<Content Include="1.2\Assemblies\Rimworld-Animations.dll" />
<Content Include="1.3\Assemblies\Rimworld-Animations.dll" />
<Content Include="About\About.xml" />
<Content Include="About\Manifest.xml" />
<Content Include="Defs\AnimationDefs\Animations_Beast.xml" />
@ -121,7 +122,6 @@
<Content Include="LoadFolders.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="1.3\Assemblies\" />
<Folder Include="Defs\JobDefs\" />
<Folder Include="Source\JobDrivers\" />
</ItemGroup>

View File

@ -11,6 +11,7 @@ using Verse;
using AlienRace;
namespace Rimworld_Animations {
[HarmonyPatch(typeof(AlienRace.HarmonyPatches), "DrawAddons")]
public static class HarmonyPatch_AlienRace {
@ -71,11 +72,23 @@ namespace Rimworld_Animations {
}
}
public static bool Prefix(PawnRenderFlags renderFlags, ref Vector3 vector, ref Vector3 headOffset, Pawn pawn, ref Quaternion quat, ref Rot4 rotation)
{
CompBodyAnimator anim = pawn.TryGetComp<CompBodyAnimator>();
if (!renderFlags.FlagSet(PawnRenderFlags.Portrait) && anim.isAnimating)
{
quat = Quaternion.AngleAxis(anim.bodyAngle, Vector3.up);
}
return true;
}
}
[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]
public static class HarmonyPatch_ResolveApparelGraphics
{
{
public static bool Prefix(ref Pawn ___pawn)
{
@ -86,4 +99,6 @@ namespace Rimworld_Animations {
return true;
}
}
}
}