diff --git a/project/SPT.Custom/Patches/EasyAssetsPatch.cs b/project/SPT.Custom/Patches/EasyAssetsPatch.cs index 06590ab..280d27a 100644 --- a/project/SPT.Custom/Patches/EasyAssetsPatch.cs +++ b/project/SPT.Custom/Patches/EasyAssetsPatch.cs @@ -95,9 +95,12 @@ namespace SPT.Custom.Patches path = BundleManager.GetBundlePath(bundleInfo); // only download when connected externally - if (await BundleManager.ShouldReaquire(bundleInfo)) + if (await BundleManager.ShouldAcquire(bundleInfo)) { - VFS.DeleteFile(BundleManager.GetBundleFilePath(bundleInfo)); + if (VFS.Exists(BundleManager.GetBundleFilePath(bundleInfo))) + { + VFS.DeleteFile(BundleManager.GetBundleFilePath(bundleInfo)); + } await BundleManager.DownloadBundle(bundleInfo); } diff --git a/project/SPT.Custom/Utils/BundleManager.cs b/project/SPT.Custom/Utils/BundleManager.cs index 93f443b..ba0f749 100644 --- a/project/SPT.Custom/Utils/BundleManager.cs +++ b/project/SPT.Custom/Utils/BundleManager.cs @@ -51,7 +51,8 @@ namespace SPT.Custom.Utils await VFS.WriteFileAsync(filepath, data); } - public static async Task ShouldReaquire(BundleItem bundle) + // Handles both the check for initially acquiring and also re-acquiring a file. + public static async Task ShouldAcquire(BundleItem bundle) { // read cache var filepath = GetBundleFilePath(bundle);