Default to the newest Base Game pack on new clusters (#1216)

A new cluster gets the default mod packs but controller.default_mod_pack_id
stays null, so the first Create save or Start fails with "Default mod pack
not set on controller". When seeding the packs, also point the default at
the newest Base Game pack, unless an admin already set one. Clusters that
already have mod packs are left alone. The config is written with the
mod packs on the next autosave or shutdown.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
BastiaanandClaude Opus 5.5 authored and GitHub committed 2026-11-17 11:03:22 +00:00
1 parent 09d79d775f
commit c2c7edf1b7
3 files changed
+44

No files matched your search

+6
View File
@@ -233,6 +233,12 @@ export default class Controller {
// Add default mod packs
if (modPacks.size === 0) {
modPacks.setMany(lib.ModPack.defaultModPacks);
if (config.get("controller.default_mod_pack_id") === null) {
const baseGame = lib.ModPack.defaultModPacks
.filter(pack => pack.name.startsWith("Base Game "))
.reduce((a, b) => (b.integerFactorioVersion > a.integerFactorioVersion ? b : a));
config.set("controller.default_mod_pack_id", baseGame.id);
}
}
// Add default roles