Protect again against replacing package
This commit is contained in:
parent
5f23dd9e52
commit
f41d2a5116
|
@ -323,6 +323,12 @@ bool UPrepareAssetsForCookingCommandlet::SavePackage(const FString &PackagePath,
|
|||
FString PackageFileName = FPackageName::LongPackageNameToFilename(PackagePath,
|
||||
FPackageName::GetMapPackageExtension());
|
||||
|
||||
if (FPaths::FileExists(*PackageFileName))
|
||||
{
|
||||
// Will not save package if it already exists
|
||||
return false;
|
||||
}
|
||||
|
||||
return UPackage::SavePackage(Package, World, EObjectFlags::RF_Public | EObjectFlags::RF_Standalone,
|
||||
*PackageFileName, GError, nullptr, true, true, SAVE_NoError);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue