Increased resilience to some modded drawables

This commit is contained in:
dexy 2020-02-25 23:30:41 +11:00
parent 126848c646
commit a41e7c5eb3
4 changed files with 15 additions and 2 deletions

View File

@ -2381,6 +2381,11 @@ namespace CodeWalker.GameFiles
{
this.VertexData = this.VertexBuffer.Data1 ?? this.VertexBuffer.Data2;
if (this.VerticesCount == 0)
{
this.VerticesCount = (ushort)(this.VertexData?.VertexCount ?? 0);
}
//if (VertexBuffer.Data1 != VertexBuffer.Data2)
//{ }//no hit
//if (VertexDataPointer == 0)

View File

@ -0,0 +1,8 @@
{
"profiles": {
"CodeWalker.RPFExplorer": {
"commandName": "Project",
"workingDirectory": ".."
}
}
}

View File

@ -580,7 +580,7 @@ namespace CodeWalker.Rendering
public override void SetModelVars(DeviceContext context, RenderableModel model)
{
if (model.Owner.Skeleton?.BoneTransforms != null)
if ((model.Owner.Skeleton?.BoneTransforms != null) && (model.Owner.Skeleton.BoneTransforms.Length > 0))
{
SetBoneMatrices(context, model.Owner.Skeleton.BoneTransforms);
defaultBoneMatricesBound = false;

View File

@ -235,7 +235,7 @@ namespace CodeWalker.Rendering
public override void SetModelVars(DeviceContext context, RenderableModel model)
{
if (model.Owner.Skeleton?.BoneTransforms != null)
if ((model.Owner.Skeleton?.BoneTransforms != null) && (model.Owner.Skeleton.BoneTransforms.Length > 0))
{
SetBoneMatrices(context, model.Owner.Skeleton.BoneTransforms);
defaultBoneMatricesBound = false;