fixed DLC files not saving correctly

This commit is contained in:
Marvelco 2026-03-12 03:36:45 +02:00
parent 8f77ffa40d
commit dd73385506

View file

@ -11,12 +11,8 @@ bool RegionFileCache::useSplitSaves(ESavePlatform platform)
{
case SAVE_FILE_PLATFORM_XBONE:
case SAVE_FILE_PLATFORM_PS4:
return true;
case SAVE_FILE_PLATFORM_WIN64:
{
LevelGenerationOptions* lgo = app.getLevelGenerationOptions();
return (lgo != nullptr && lgo->isFromDLC());
}
return true;
default:
return false;
};
@ -35,7 +31,11 @@ RegionFile *RegionFileCache::_getRegionFile(ConsoleSaveFile *saveFile, const wst
File file;
if(useSplitSaves(saveFile->getSavePlatform()))
{
file = File( prefix + wstring(L"r.") + std::to_wstring(chunkX>>4) + L"." + std::to_wstring(chunkZ>>4) + L".mcr" );
File oldFile(prefix + wstring(L"r.") + std::to_wstring(chunkX >> 5) + L"." + std::to_wstring(chunkZ >> 5) + L".mcr");
if (oldFile.exists())
file = oldFile;
else
file = File(prefix + wstring(L"r.") + std::to_wstring(chunkX >> 4) + L"." + std::to_wstring(chunkZ >> 4) + L".mcr");
}
else
{