From 3eb07c59561ecac5ee9ea4022ea6a4413447e367 Mon Sep 17 00:00:00 2001 From: yairm210 Date: Tue, 9 Jul 2024 14:03:33 +0300 Subject: [PATCH] Delete temporary files created when downloading mods --- core/src/com/unciv/UncivGame.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/com/unciv/UncivGame.kt b/core/src/com/unciv/UncivGame.kt index 1a415a0c18..2d0f23bd67 100644 --- a/core/src/com/unciv/UncivGame.kt +++ b/core/src/com/unciv/UncivGame.kt @@ -93,6 +93,11 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci } Current = this files = UncivFiles(Gdx.files) + Concurrency.run { + // Delete temporary files created when downloading mods + val tempFiles = Gdx.files.local("mods").list().filter { !it.isDirectory && it.name().startsWith("temp-") } + for (file in tempFiles) file.delete() + } // If this takes too long players, especially with older phones, get ANR problems. // Whatever needs graphics needs to be done on the main thread,