@@ -18,7 +18,7 @@ void SatisfactorySave::PakManager::init(const std::filesystem::path& gameDir) {
1818 if (!std::filesystem::is_regular_file (globalUtocPath)) {
1919 throw std::runtime_error (" Global utoc file not found!" );
2020 }
21- auto globalUtoc = std::make_shared<IoStoreFile> (shared_from_this (), globalUtocPath);
21+ auto globalUtoc = IoStoreFile::create (shared_from_this (), globalUtocPath);
2222 const auto globalBuf = globalUtoc->readChunkContent (0 );
2323 IStreamArchive globalAr (globalBuf);
2424 globalAr << GlobalNameMap;
@@ -31,13 +31,13 @@ void SatisfactorySave::PakManager::init(const std::filesystem::path& gameDir) {
3131 if (!std::filesystem::is_regular_file (mainPakPath)) {
3232 throw std::runtime_error (" Main pak file not found!" );
3333 }
34- pakFiles_.push_back (std::make_shared<PakFile> (shared_from_this (), mainPakPath));
34+ pakFiles_.push_back (PakFile::create (shared_from_this (), mainPakPath));
3535 cacheLatestPakNames ();
3636
3737 if (!std::filesystem::is_regular_file (mainUtocPath)) {
3838 throw std::runtime_error (" Main utoc file not found!" );
3939 }
40- pakFiles_.push_back (std::make_shared<IoStoreFile> (shared_from_this (), mainUtocPath));
40+ pakFiles_.push_back (IoStoreFile::create (shared_from_this (), mainUtocPath));
4141 cacheLatestPakNames ();
4242
4343 // Search for Mod pak/utoc files.
@@ -76,9 +76,9 @@ void SatisfactorySave::PakManager::init(const std::filesystem::path& gameDir) {
7676 std::shared_ptr<AbstractPakFile> pak;
7777 try {
7878 if (is_pak) {
79- pak = std::make_shared<PakFile> (shared_from_this (), filePath);
79+ pak = PakFile::create (shared_from_this (), filePath);
8080 } else if (is_utoc) {
81- pak = std::make_shared<IoStoreFile> (shared_from_this (), filePath);
81+ pak = IoStoreFile::create (shared_from_this (), filePath);
8282 }
8383 } catch (const std::exception& ex) {
8484 spdlog::error (" Error reading pak/utoc file: {}" , ex.what ());
0 commit comments