mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 15:27:27 +07:00
Mods with atlases that reference non-existent files will no longer cause crashes
This commit is contained in:
parent
927aa8a788
commit
9b5ded43d4
@ -103,9 +103,14 @@ object ImageGetter {
|
||||
val extraAtlas = if (mod.isEmpty()) fileName else if (fileName == "game") mod else "$mod/$fileName"
|
||||
var tempAtlas = atlases[extraAtlas] // fetch if cached
|
||||
if (tempAtlas == null) {
|
||||
try {
|
||||
debug("Loading %s = %s", extraAtlas, file.path())
|
||||
tempAtlas = TextureAtlas(file) // load if not
|
||||
atlases[extraAtlas] = tempAtlas // cache the freshly loaded
|
||||
} catch (ex: Exception){
|
||||
debug("Could not load file $file")
|
||||
continue
|
||||
}
|
||||
}
|
||||
for (region in tempAtlas.regions) {
|
||||
if (region.name.startsWith("Skins")) {
|
||||
|
Loading…
Reference in New Issue
Block a user