Change "try .. catch" statement to "if(consoleMode)" statement for mods folder loading. (#2802)

This commit is contained in:
Alexander Korolyov 2020-07-05 05:27:41 +02:00 committed by GitHub
parent 84a06b7fcb
commit ad89286476
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,12 +191,8 @@ object RulesetCache :HashMap<String,Ruleset>() {
this[ruleset.fullName] = Ruleset().apply { load(fileHandle) } this[ruleset.fullName] = Ruleset().apply { load(fileHandle) }
} }
var modsHandles: Array<FileHandle> var modsHandles = if(consoleMode) FileHandle("mods").list()
try { else Gdx.files.local("mods").list()
modsHandles = Gdx.files.local("mods").list()
} catch (ex: NullPointerException) {
modsHandles = FileHandle("mods").list()
}
for (modFolder in modsHandles) { for (modFolder in modsHandles) {
if (modFolder.name().startsWith('.')) continue if (modFolder.name().startsWith('.')) continue