Actually fix default dimensions with multiple mods
This commit is contained in:
+4
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user