diff --git a/source/funkin/backend/assets/AssetsLibraryList.hx b/source/funkin/backend/assets/AssetsLibraryList.hx index 096c82dc..744feed2 100644 --- a/source/funkin/backend/assets/AssetsLibraryList.hx +++ b/source/funkin/backend/assets/AssetsLibraryList.hx @@ -100,15 +100,11 @@ class AssetsLibraryList extends AssetLibrary { public function getSpecificAsset(id:String, type:String, source:AssetSource = BOTH, ?avoidRoot:Bool = false):Dynamic { try { - var fileFromAssets:Bool = id.startsWith("assets/"); - - if (!fileFromAssets) { + if (!id.startsWith("assets/")) { var ass = getSpecificAsset('assets/$id', type, source); if (ass != null) return ass; - } - - if (fileFromAssets) { + } else { for (lib in assetsLibs) { if (shouldSkipLib(libraries.indexOf(lib), source)) continue; @@ -116,7 +112,9 @@ class AssetsLibraryList extends AssetLibrary { if (asset != null) return asset; } - } else if (!avoidRoot) { + } + + if (!avoidRoot) { for (lib in rootLibs) { if (shouldSkipLib(libraries.indexOf(lib), source)) continue; @@ -182,7 +180,7 @@ class AssetsLibraryList extends AssetLibrary { if (finalLib is IModsAssetLibrary) assetsLibs.insert(0, finalLib); - else + else rootLibs.insert(0, finalLib); return lib; } diff --git a/source/funkin/menus/credits/CreditsMain.hx b/source/funkin/menus/credits/CreditsMain.hx index a7edeb68..af62af37 100644 --- a/source/funkin/menus/credits/CreditsMain.hx +++ b/source/funkin/menus/credits/CreditsMain.hx @@ -20,11 +20,12 @@ class CreditsMain extends TreeMenu { add(bg); var selectables:Array = []; + var xmlPath = Paths.xml('config/credits'); for(source in [funkin.backend.assets.AssetsLibraryList.AssetSource.SOURCE, funkin.backend.assets.AssetsLibraryList.AssetSource.MODS]) { - if (Paths.assetsTree.existsSpecific(Paths.xml('config/credits'), "TEXT", source)) { + if (Paths.assetsTree.existsSpecific(xmlPath, "TEXT", source)) { var access:Access = null; try { - access = new Access(Xml.parse(Paths.assetsTree.getSpecificAsset(Paths.xml('config/credits'), "TEXT", source))); + access = new Access(Xml.parse(Paths.assetsTree.getSpecificAsset(xmlPath, "TEXT", source))); } catch(e) { Logs.trace('Error while parsing credits.xml: ${Std.string(e)}', ERROR); }