diff --git a/src/configfile.cpp b/src/configfile.cpp index 9a1f7bd4d..e64005fc4 100644 --- a/src/configfile.cpp +++ b/src/configfile.cpp @@ -513,6 +513,22 @@ FConfigFile::FConfigSection *FConfigFile::FindSection (const char *name) const return section; } +//==================================================================== +// +// FConfigFile :: RenameSection +// +//==================================================================== + +void FConfigFile::RenameSection (const char *oldname, const char *newname) const +{ + FConfigSection *section = FindSection(oldname); + + if (section != NULL) + { + section->SectionName = newname; + } +} + //==================================================================== // // FConfigFile :: FindEntry diff --git a/src/configfile.h b/src/configfile.h index 31943ccb6..e125351dc 100644 --- a/src/configfile.h +++ b/src/configfile.h @@ -78,6 +78,7 @@ protected: virtual char *ReadLine (char *string, int n, void *file) const; bool ReadConfig (void *file); static const char *GenerateEndTag(const char *value); + void RenameSection(const char *oldname, const char *newname) const; bool OkayToWrite; bool FileExisted; diff --git a/src/gameconfigfile.cpp b/src/gameconfigfile.cpp index 7e0ddc6a1..9121e79d6 100644 --- a/src/gameconfigfile.cpp +++ b/src/gameconfigfile.cpp @@ -334,6 +334,26 @@ void FGameConfigFile::DoGlobalSetup () SetValueForKey ("5", "use ArtiInvulnerability2"); } } + if (last < 211) + { + //RenameSection("Hacx2.Autoload", "hacx.2_0.Autoload"); + //RenameSection("Hacx12.Autoload", "hacx.1_2.Autoload"); + //RenameSection("Hexen1.Autoload", "hexen.hexen.Autoload"); + RenameSection("Chex3.Autoload", "chex.3.Autoload"); + RenameSection("Chex1.Autoload", "chex.1.Autoload"); + RenameSection("HexenDK.Autoload", "hexen.deathkings.Autoload"); + RenameSection("HereticSR.Autoload", "heretic.shadow.Autoload"); + RenameSection("FreeDM.Autoload", "doom.freedoom.freedm.Autoload"); + RenameSection("Freedoom2.Autoload", "doom.freedoom.phase2.Autoload"); + RenameSection("Freedoom1.Autoload", "doom.freedoom.phase1.Autoload"); + RenameSection("DoomBFG.Autoload", "doom.doom1.bfg.Autoload"); + RenameSection("DoomU.Autoload", "doom.doom1.ultimate.Autoload"); + RenameSection("Doom1.Autoload", "doom.doom1.registered.Autoload"); + RenameSection("TNT.Autoload", "doom.doom2.tnt.Autoload"); + RenameSection("Plutonia.Autoload", "doom.doom2.plutonia.Autoload"); + RenameSection("Doom2BFG.Autoload", "doom.doom2.bfg.Autoload"); + RenameSection("Doom2.Autoload", "doom.doom2.commercial.Autoload"); + } } } } diff --git a/src/version.h b/src/version.h index cbbb8bd21..f45f58b2f 100644 --- a/src/version.h +++ b/src/version.h @@ -56,7 +56,7 @@ const char *GetVersionString(); // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to // be able to migrate in FGameConfigFile::DoGlobalSetup(). -#define LASTRUNVERSION "210" +#define LASTRUNVERSION "211" // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones.