From 32a7e6c1d12373a2e471df084c016b2d426acc7f Mon Sep 17 00:00:00 2001 From: theHostileNegotiator <61142710+theHostileNegotiator@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:25:50 +1000 Subject: [PATCH] Fix W3D Mesh compilation --- SAGE/Games/Kane's Wrath/W3DMesh.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SAGE/Games/Kane's Wrath/W3DMesh.cs b/SAGE/Games/Kane's Wrath/W3DMesh.cs index ee6ccdb..335a71d 100644 --- a/SAGE/Games/Kane's Wrath/W3DMesh.cs +++ b/SAGE/Games/Kane's Wrath/W3DMesh.cs @@ -1196,11 +1196,11 @@ public override bool Compile(GameAssetType gameAsset, Uri baseUri, BinaryAsset a ushort bone = ushort.Parse(boneinfluenceNode.Attributes.GetNamedItem("Bone").Value); if (bones.Contains(bone)) { - boneinfluence.Bones.X = bones.IndexOf(bone); + boneinfluence.Bones.X = (short)bones.IndexOf(bone); } else { - boneinfluence.Bones.X = bones.Count; + boneinfluence.Bones.X = (short)bones.Count; bones.Add(bone); } boneinfluence.Influences.X = float.Parse(boneinfluenceNode.Attributes.GetNamedItem("Weight").Value, NumberFormatInfo.InvariantInfo); @@ -1219,11 +1219,11 @@ public override bool Compile(GameAssetType gameAsset, Uri baseUri, BinaryAsset a ushort bone = ushort.Parse(boneinfluenceNode.Attributes.GetNamedItem("Bone").Value); if (bones.Contains(bone)) { - boneinfluenceList[idx].Bones.Y = bones.IndexOf(bone); + boneinfluenceList[idx].Bones.Y = (short)bones.IndexOf(bone); } else { - boneinfluenceList[idx].Bones.Y = bones.Count; + boneinfluenceList[idx].Bones.Y = (short)bones.Count; bones.Add(bone); } boneinfluenceList[idx].Influences.Y = float.Parse(boneinfluenceNode.Attributes.GetNamedItem("Weight").Value, NumberFormatInfo.InvariantInfo); @@ -1371,7 +1371,7 @@ public override bool Compile(GameAssetType gameAsset, Uri baseUri, BinaryAsset a } break; case VertexElementUsage.COLOR: - List colorsList = vertexData.VertexColors; + List colorsList = vertexData.VertexColors; if (colorsList != null) { for (int idy = 0; idy < colorsList.Count; ++idy)