diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index c03ed7a2f..393ca11cc 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -137,6 +137,12 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize) sc.MustGetString(); iwad->Autoname = sc.String; } + else if (sc.Compare("Group")) + { + sc.MustGetStringName("="); + sc.MustGetString(); + iwad->Group = sc.String; + } else if (sc.Compare("Config")) { sc.MustGetStringName("="); diff --git a/src/d_main.cpp b/src/d_main.cpp index 817d3b9ec..5e21867bb 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1989,7 +1989,7 @@ static void D_DoomInit() // //========================================================================== -static void AddAutoloadFiles(const char *gamesection) +static void AddAutoloadFiles(const char *group, const char *autoname) { if (!(gameinfo.flags & GI_SHAREWARE) && !Args->CheckParm("-noautoload")) { @@ -2026,10 +2026,18 @@ static void AddAutoloadFiles(const char *gamesection) file += ".Autoload"; D_AddConfigWads (allwads, file); + // Add group-specific wads + if (group != NULL) + { + file = group; + file += ".Autoload"; + D_AddConfigWads(allwads, file); + } + // Add IWAD-specific wads - if (gamesection != NULL) + if (autoname != NULL) { - file = gamesection; + file = autoname; file += ".Autoload"; D_AddConfigWads(allwads, file); } @@ -2262,7 +2270,7 @@ void D_DoomMain (void) FBaseCVar::DisableCallbacks(); GameConfig->DoGameSetup (gameinfo.ConfigName); - AddAutoloadFiles(iwad_info->Autoname); + AddAutoloadFiles(iwad_info->Group, iwad_info->Autoname); // Run automatically executed files execFiles = new DArgs; diff --git a/src/d_main.h b/src/d_main.h index e4641c41d..dd2ffc409 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -75,6 +75,7 @@ struct FIWADInfo { FString Name; // Title banner text for this IWAD FString Autoname; // Name of autoload ini section for this IWAD + FString Group; // Groupname for this IWAD FString Configname; // Name of config section for this IWAD FString Required; // Requires another IWAD DWORD FgColor; // Foreground color for title banner