diff --git a/Source/CombatExtended/Harmony/Harmony_PawnRenderer.cs b/Source/CombatExtended/Harmony/Harmony_PawnRenderer.cs index 3ba9f318b4..d952256b27 100644 --- a/Source/CombatExtended/Harmony/Harmony_PawnRenderer.cs +++ b/Source/CombatExtended/Harmony/Harmony_PawnRenderer.cs @@ -60,11 +60,13 @@ private static void DrawMesh(Mesh mesh, Matrix4x4 matrix, Material mat, int laye muzzleJump = -muzzleJump; casingOffset.x *= -1; } - matrix.SetTRS(position + posVec.RotatedBy(matrix.rotation.eulerAngles.y) + recoilOffset, Quaternion.AngleAxis(matrix.rotation.eulerAngles.y + muzzleJump, Vector3.up), scale); + + float yAngle = matrix.rotation.eulerAngles.y; + matrix.SetTRS(position + posVec.RotatedBy(yAngle) + recoilOffset, Quaternion.AngleAxis(yAngle + muzzleJump, Vector3.up), scale); CompEquippable compEquippable = eq.TryGetComp(); if (compEquippable != null && compEquippable.PrimaryVerb is Verb_ShootCE verbCE) { - verbCE.drawPos = casingDrawPos + (casingOffset + posVec).RotatedBy(matrix.rotation.eulerAngles.y); + verbCE.drawPos = casingDrawPos + (casingOffset + posVec).RotatedBy(yAngle); } if (eq is WeaponPlatform platform) {