diff --git a/src/k_credits.cpp b/src/k_credits.cpp index d867e2b6e..6c14f4dc1 100644 --- a/src/k_credits.cpp +++ b/src/k_credits.cpp @@ -555,7 +555,6 @@ static boolean F_CreditsPlayDemo(void) UINT8 ghost_id = M_RandomKey( mapheaderinfo[map_id]->ghostCount ); brief = mapheaderinfo[map_id]->ghostBrief[ghost_id]; - std::string demo_name = static_cast(W_CheckNameForNumPwad(brief->wad, brief->lump)); demo.attract = DEMO_ATTRACT_CREDITS; demo.ignorefiles = true; diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 058f4a792..b1d011b07 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -7901,7 +7901,7 @@ static void P_LoadRecordGhosts(void) savebuffer_t buf = {0}; staffbrief_t* ghostbrief = mapheaderinfo[gamemap-1]->ghostBrief[i - 1]; - const char* lumpname = W_CheckNameForNumPwad(ghostbrief->wad, ghostbrief->lump); + const char* lumpname = W_CheckLongNameForNumPwad(ghostbrief->wad, ghostbrief->lump); size_t lumplength = W_LumpLengthPwad(ghostbrief->wad, ghostbrief->lump); if (lumplength == 0) { diff --git a/src/w_wad.cpp b/src/w_wad.cpp index 604ed203e..8d31c97a1 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -1021,6 +1021,19 @@ const char *W_CheckNameForNum(lumpnum_t lumpnum) return W_CheckNameForNumPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum)); } +const char *W_CheckLongNameForNumPwad(UINT16 wad, UINT16 lump) +{ + if (lump >= wadfiles[wad]->numlumps || !TestValidLump(wad, 0)) + return NULL; + + return wadfiles[wad]->lumpinfo[lump].longname; +} + +const char *W_CheckLongNameForNum(lumpnum_t lumpnum) +{ + return W_CheckLongNameForNumPwad(WADFILENUM(lumpnum),LUMPNUM(lumpnum)); +} + // // wadid is a wad number // (Used for sprites loading) diff --git a/src/w_wad.h b/src/w_wad.h index d224475d9..a928ffc44 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -154,6 +154,8 @@ INT32 W_InitMultipleFiles(char **filenames, boolean addons); const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump); const char *W_CheckNameForNum(lumpnum_t lumpnum); +const char *W_CheckLongNameForNumPwad(UINT16 wad, UINT16 lump); +const char *W_CheckLongNameForNum(lumpnum_t lumpnum); UINT16 W_FindNextEmptyInPwad(UINT16 wad, UINT16 startlump); // checks only in one pwad