From 954156cd1ba98d9d2f7fd6f778872c9cfbee599f Mon Sep 17 00:00:00 2001 From: NepDisk Date: Wed, 5 Feb 2025 17:53:53 -0500 Subject: [PATCH] Long Map Names Port pt 2. --- src/deh_soc.c | 14 +++++++++----- src/p_setup.c | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/deh_soc.c b/src/deh_soc.c index 5b4466e0e..a6a44456b 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -1073,11 +1073,15 @@ void readlevelheader(MYFILE *f, char * name) I_Error("Too many maps!"); } - if (mapheaderinfo[num-1]) - G_SetGameModified(multiplayer, true); // only mark as a major mod if it replaces an already-existing mapheaderinfo - - // Reset all previous map header information - P_AllocMapHeader((INT16)(num-1)); + if (num >= nummapheaders) + { + P_AllocMapHeader((INT16)(num -1)); + } + else if (f->wad > mainwads) + { + // only mark as a major mod if it replaces an already-existing mapheaderinfo + G_SetGameModified(multiplayer, true); + } if (mapheaderinfo[num-1]->lumpname == NULL) { diff --git a/src/p_setup.c b/src/p_setup.c index 0791b6ffd..4d9b91e67 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -469,6 +469,7 @@ void P_AllocMapHeader(INT16 i) if (!mapheaderinfo[i]) { mapheaderinfo[i] = Z_Malloc(sizeof(mapheader_t), PU_STATIC, NULL); + mapheaderinfo[i]->lumpnum = LUMPERROR; mapheaderinfo[i]->lumpname = NULL; mapheaderinfo[i]->flickies = NULL; mapheaderinfo[i]->grades = NULL;