diff --git a/Galanthus/SdfToc.cs b/Galanthus/SdfToc.cs index d508679..bf439c0 100644 --- a/Galanthus/SdfToc.cs +++ b/Galanthus/SdfToc.cs @@ -368,13 +368,13 @@ public bool TryGetDataFile(DataSlice inSlice, [NotNullWhen(true)] out string? pa int outBufferSize = 0; // get final file size - foreach (DataSlice dataSlice in inAsset.DataSlices) + if (inAsset.DdsIndex != -1) { - if (inAsset.DdsIndex != -1) - { - outBufferSize += m_ddsHeaders[inAsset.DdsIndex].Size; - } + outBufferSize += m_ddsHeaders[inAsset.DdsIndex].Size; + } + foreach (DataSlice dataSlice in inAsset.DataSlices) + { if (!TryGetDataFile(dataSlice, out string? _)) { continue; @@ -385,7 +385,6 @@ public bool TryGetDataFile(DataSlice inSlice, [NotNullWhen(true)] out string? pa } Block outBuffer = new(outBufferSize); - // add dds header if (inAsset.DdsIndex != -1) {