Skip to content

Commit

Permalink
Fix api models not exporting all parts?
Browse files Browse the repository at this point in the history
  • Loading branch information
DeltaDesigns committed Nov 6, 2023
1 parent 995f6d5 commit 5b041c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions Tiger/Exporters/Exporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,13 @@ public void AddEntity(FileHash entityHash, List<DynamicMeshPart> parts, List<Bon
DynamicMeshPart part = parts[i];
if (part.Material == null)
continue;
if (part.Material.EnumeratePSTextures().Any()) //Dont know if this will 100% "fix" the duplicate meshs that come with entities
{
mesh.AddPart(entityHash, part, i);
}

//No longer needed because of EntityModel.cs line 107?
//if (part.Material.EnumeratePSTextures().Any()) //Dont know if this will 100% "fix" the duplicate meshs that come with entities
//{
// mesh.AddPart(entityHash, part, i);
//}
mesh.AddPart(entityHash, part, i);
}
Entities.Add(new ExporterEntity { Mesh = mesh, BoneNodes = boneNodes });
}
Expand Down
2 changes: 1 addition & 1 deletion Tiger/Schema/Investment/InvestmentHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ private Entity.Entity GetEntityFromAssignmentHash(TigerHash assignmentHash)
// var index = _entityAssignmentsMap.TagData.EntityArrangementMap.BinarySearch(x, new D2Class_454F8080());
Tag<D2Class_A36F8080> tag = _sortedArrangementHashmap[assignmentHash];
tag.Load();
if (tag.TagData.EntityData is null)
if (tag.TagData.EntityData.IsInvalid() || tag.TagData.EntityData is null)
return null;
// if entity
if (tag.TagData.EntityData.GetReferenceHash() == 0x80809ad8)
Expand Down

0 comments on commit 5b041c4

Please sign in to comment.