Demos: Use long lumpname when handling staff ghost information

Implements new W_CheckLongNameForNum funcs, which are broadly copypasted from W_CheckNameForNum
This commit is contained in:
toaster 2024-05-01 19:55:30 +01:00
parent 7390ee5442
commit 9d0c9ece4b
4 changed files with 16 additions and 2 deletions

View file

@ -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<const char *>(W_CheckNameForNumPwad(brief->wad, brief->lump));
demo.attract = DEMO_ATTRACT_CREDITS;
demo.ignorefiles = true;

View file

@ -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)
{

View file

@ -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)

View file

@ -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