diff --git a/KeepersCompound.LGS/ModelFile.cs b/KeepersCompound.LGS/ModelFile.cs index 38f1d83..1c68849 100644 --- a/KeepersCompound.LGS/ModelFile.cs +++ b/KeepersCompound.LGS/ModelFile.cs @@ -317,7 +317,7 @@ public class ModelFile var objTrans = Matrix4x4.Identity; if (subObj.Joint != -1) { - var ang = float.DegreesToRadians(joints[subObj.Joint]); + var ang = subObj.Joint >= joints.Length ? 0 : float.DegreesToRadians(joints[subObj.Joint]); // TODO: Is this correct? Should I use a manual rotation matrix? var jointRot = Matrix4x4.CreateFromYawPitchRoll(0, ang, 0); objTrans = jointRot * subObj.Transform;