diff --git a/arm9/source/utils/gameutil.c b/arm9/source/utils/gameutil.c index 7aaf04a..1ea3f58 100644 --- a/arm9/source/utils/gameutil.c +++ b/arm9/source/utils/gameutil.c @@ -1609,13 +1609,14 @@ u32 BuildCiaFromNcsdFile(const char* path_ncsd, const char* path_cia) { // insert NCSD content TmdContentChunk* chunk = cia->content_list; - for (u32 i = 0; i < 3; i++) { + for (u32 i = 0, idx = 0; i < 3; i++) { NcchPartition* partition = ncsd.partitions + i; u32 offset = partition->offset * NCSD_MEDIA_UNIT; u32 size = partition->size * NCSD_MEDIA_UNIT; if (!size) continue; memset(chunk, 0, sizeof(TmdContentChunk)); - chunk->id[3] = chunk->index[1] = i; + chunk->id[3] = i; + chunk->index[1] = idx++; if (InsertCiaContent(path_cia, path_ncsd, offset, size, chunk++, NULL, false, (i == 0), false) != 0) { free(cia); return 1;