mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Fix phantom state of opted-out files made non-optional
This commit is contained in:
parent
7568770078
commit
73d21a475a
@ -182,14 +182,14 @@ internal class DownloadTask private constructor(val metadata: IndexFile.File, de
|
|||||||
|
|
||||||
// Ensure wrong-side or optional false files are removed
|
// Ensure wrong-side or optional false files are removed
|
||||||
cachedFile?.let {
|
cachedFile?.let {
|
||||||
if (!it.optionValue || !correctSide()) {
|
if ((it.isOptional && !it.optionValue) || !correctSide()) {
|
||||||
if (it.cachedLocation == null) return
|
if (it.cachedLocation != null) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
Files.deleteIfExists(Paths.get(packFolder, it.cachedLocation))
|
||||||
} catch (e: IOException) {
|
} catch (e: IOException) {
|
||||||
Log.warn("Failed to delete file before downloading", e)
|
Log.warn("Failed to delete file before downloading", e)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
it.cachedLocation = null
|
it.cachedLocation = null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user