@ECHO OFF
ECHO Recombining final level archives...
FOR %%L IN (0 1 2 3 4 6 8 9 10 11 12 13 14 18 19) DO (
    FOR %%D IN (..\GameDataFolder\level%%L_Final) DO (
        IF EXIST %%D (
            IF EXIST ..\..\GameDataFolder\level0_Final.sep (
                OniSplit.exe -import:sep %%D %%D.dat
            ) ELSE (
                OniSplit.exe -import:nosep %%D %%D.dat
            )
        )
    )
)
XCOPY ..\..\GameDataFolder\IGMD ..\GameDataFolder\IGMD /S /I /Y
COPY ..\..\persist.dat ..\persist.dat
COPY ..\..\key_config.txt ..\key_config.txt
