diff --git a/1.2/Assemblies/Rimworld-Animations.dll b/1.2/Assemblies/Rimworld-Animations.dll index da4ab3d..0c115d3 100644 Binary files a/1.2/Assemblies/Rimworld-Animations.dll and b/1.2/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/Patches/HarmonyPatch_AlienRace.cs b/Source/Patches/HarmonyPatch_AlienRace.cs index cc06988..0391195 100644 --- a/Source/Patches/HarmonyPatch_AlienRace.cs +++ b/Source/Patches/HarmonyPatch_AlienRace.cs @@ -39,7 +39,7 @@ namespace Rimworld_Animations { return true; } - public static bool Prefix_AnimateHeadAddons(bool portrait, Vector3 vector, Pawn pawn, Quaternion quat, Rot4 rotation, bool invisible) { + public static bool Prefix_AnimateHeadAddons(bool portrait, Vector3 vector, Vector3 headOffset, Pawn pawn, Quaternion quat, Rot4 rotation, bool invisible) { if (portrait || pawn.TryGetComp() == null || !pawn.TryGetComp().isAnimating) return true; if (!(pawn.def is ThingDef_AlienRace alienProps) || invisible) return false; @@ -103,6 +103,8 @@ namespace Rimworld_Animations { num = 0; } + moffsetX += bodyOffset.x + crownOffset.x; + moffsetZ += bodyOffset.y + crownOffset.y; if (((ba.drawnInBed || ba.alignWithHead) ? pawnAnimator.headFacing : rotation) == Rot4.East) { moffsetX = -moffsetX; @@ -117,14 +119,14 @@ namespace Rimworld_Animations { Graphic addonGraphic = alienComp.addonGraphics[i]; addonGraphic.drawSize = (portrait && ba.drawSizePortrait != Vector2.zero ? ba.drawSizePortrait : ba.drawSize) * (ba.scaleWithPawnDrawsize ? alienComp.customDrawSize : Vector2.one) * 1.5f; - if (ba.drawnInBed || ba.alignWithHead && pawn.TryGetComp() != null && pawn.TryGetComp().isAnimating) { + if ((ba.drawnInBed || ba.alignWithHead) && pawn.TryGetComp() != null && pawn.TryGetComp().isAnimating) { Quaternion headQuatInAnimation = Quaternion.AngleAxis(pawnAnimator.headAngle, Vector3.up); Rot4 headRotInAnimation = pawnAnimator.headFacing; Vector3 headPositionInAnimation = pawnAnimator.getPawnHeadPosition() - pawn.Drawer.renderer.BaseHeadOffsetAt(pawnAnimator.headFacing).RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: headQuatInAnimation)) * 2f * 57.29578f); - GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: headRotInAnimation), loc: headPositionInAnimation + offsetVector.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: headQuatInAnimation)) * 2f * 57.29578f), + GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: headRotInAnimation), loc: headPositionInAnimation + (ba.alignWithHead ? headOffset : Vector3.zero) + offsetVector.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: headQuatInAnimation)) * 2f * 57.29578f), quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * headQuatInAnimation, mat: addonGraphic.MatAt(rot: pawnAnimator.headFacing), drawNow: portrait); }