Actually fix default dimensions with multiple mods

This commit is contained in:
2026-11-15 09:53:31 -03:00
parent 2282abc3bc
commit afacd10a18
5 changed files with 16 additions and 12 deletions
+4 -1
View File
@@ -42,7 +42,10 @@ let repo_mods: ServerModSource[] | undefined;
// own copy, so a test that changes what it got can't change another test's
export async function mod_sources(mods_dir: string): Promise<ServerModSource[]> {
if (resolve(mods_dir) !== resolve("mods")) return await read_mod_sources(mods_dir);
repo_mods ??= await read_mod_sources(mods_dir);
// other games in mods/, the ones with a default dimension of their own, are left out: tests play bworld
repo_mods ??= (await read_mod_sources(mods_dir)).filter((mod) =>
mod.listing.id === "bworld" || !mod.data.dimensions?.some((json) => json.default)
);
return structuredClone(repo_mods);
}