diff --git a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs index 58d7095..8265371 100644 --- a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs +++ b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs @@ -315,7 +315,7 @@ namespace CodeWalker.GameFiles YmapEntityDef d = alldefs[i]; int pind = d._CEntityDef.parentIndex; bool isroot = false; - if ((pind < 0) || (pind >= alldefs.Count) || (pind >= i)) //index check? might be a problem + if ((pind < 0) || d.LodInParentYmap) { isroot = true; } @@ -912,7 +912,7 @@ namespace CodeWalker.GameFiles } //pind = 0; } - if ((pind >= 0) && (pind < AllEntities.Length)) + if ((pind >= 0) && (pind < AllEntities.Length) && rcent.LodInParentYmap) { var pentity = AllEntities[pind]; pentity.AddChild(rcent); @@ -1718,6 +1718,8 @@ namespace CodeWalker.GameFiles public LightInstance[] Lights { get; set; } //public uint[] LightHashTest { get; set; } + public bool LodInParentYmap { get { return ((_CEntityDef.flags >> 3) & 1) > 0; } } + public string Name {