Add load argument to unlinker to load zones before trying to unlink specified zones

this allows to make sure certain ipaks are loaded before dumping
This commit is contained in:
Jan
2021-03-27 16:45:30 +01:00
parent 7d4029b21f
commit 4f995751ce
10 changed files with 158 additions and 81 deletions

View File

@ -16,7 +16,7 @@ IZoneLoaderFactory* ZoneLoaderFactories[]
new T6::ZoneLoaderFactory()
};
Zone* ZoneLoading::LoadZone(const std::string& path)
std::unique_ptr<Zone> ZoneLoading::LoadZone(const std::string& path)
{
auto zoneName = fs::path(path).filename().replace_extension("").string();
std::ifstream file(path, std::fstream::in | std::fstream::binary);
@ -50,9 +50,9 @@ Zone* ZoneLoading::LoadZone(const std::string& path)
return nullptr;
}
auto* loadedZone = zoneLoader->LoadZone(file);
auto loadedZone = zoneLoader->LoadZone(file);
delete zoneLoader;
file.close();
return loadedZone;
return std::move(loadedZone);
}