mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
always save the map WAD in a savegame's metadata, even if it is from the IWAD
Otherwise the savegame loader will not be able to validate an IWAD savegame while the actual level comes from a different file.
This commit is contained in:
parent
1e8b3ea65d
commit
a8c1f7a637
1 changed files with 6 additions and 9 deletions
|
@ -1890,12 +1890,12 @@ static bool CheckSingleWad (const char *name, bool &printRequires, bool printwar
|
||||||
bool G_CheckSaveGameWads (FSerializer &arc, bool printwarn)
|
bool G_CheckSaveGameWads (FSerializer &arc, bool printwarn)
|
||||||
{
|
{
|
||||||
bool printRequires = false;
|
bool printRequires = false;
|
||||||
const char* text;
|
|
||||||
|
|
||||||
text = arc.GetString("Game WAD");
|
const char *text = arc.GetString("Game WAD");
|
||||||
CheckSingleWad (text, printRequires, printwarn);
|
CheckSingleWad (text, printRequires, printwarn);
|
||||||
text = arc.GetString("Map WAD");
|
const char *text2 = arc.GetString("Map WAD");
|
||||||
if (text != nullptr) CheckSingleWad (text, printRequires, printwarn);
|
// do not validate the same file twice.
|
||||||
|
if (text != nullptr && text2 != nullptr && stricmp(text, text2) != 0) CheckSingleWad (text2, printRequires, printwarn);
|
||||||
|
|
||||||
if (printRequires)
|
if (printRequires)
|
||||||
{
|
{
|
||||||
|
@ -2268,11 +2268,8 @@ static void PutSaveWads (FSerializer &arc)
|
||||||
arc.AddString("Game WAD", name);
|
arc.AddString("Game WAD", name);
|
||||||
|
|
||||||
// Name of wad the map resides in
|
// Name of wad the map resides in
|
||||||
if (fileSystem.GetFileContainer (primaryLevel->lumpnum) > fileSystem.GetIwadNum())
|
name = fileSystem.GetResourceFileName (fileSystem.GetFileContainer (primaryLevel->lumpnum));
|
||||||
{
|
arc.AddString("Map WAD", name);
|
||||||
name = fileSystem.GetResourceFileName (fileSystem.GetFileContainer (primaryLevel->lumpnum));
|
|
||||||
arc.AddString("Map WAD", name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PutSaveComment (FSerializer &arc)
|
static void PutSaveComment (FSerializer &arc)
|
||||||
|
|
Loading…
Reference in a new issue