Skip to content

Commit

Permalink
Fixed: Failed to locate map data from Memento Mori add-on for Doom
Browse files Browse the repository at this point in the history
In the Mac Hexen demo some lump names have extra values or'd into
the lump names stored in the lump directory. The WAD file loader
will remove these values when reading the lump directory.

Many of the lump names in Memento Mori's MM.wad similarly have extra
values which appear after the last character in the name.

When translating the lump names ensure that we stop when the name
ends rather than always process all eight characters.
  • Loading branch information
danij-deng committed Aug 19, 2012
1 parent be559c2 commit b25d997
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doomsday/engine/portable/src/wadfile.c
Expand Up @@ -106,7 +106,7 @@ static void WadFile_ReadLumpDirectory(WadFile* wad)
size_t lumpDirSize;
ddstring_t absPath;
const char* ext;
int i, j;
int i, j, nameLen;
assert(wad);

if(wad->lumpRecordsCount <= 0) return;
Expand Down Expand Up @@ -138,8 +138,12 @@ static void WadFile_ReadLumpDirectory(WadFile* wad)
F_InitLumpInfo(&record->info);
record->info.lumpIdx = i;

nameLen = 0;
while(nameLen < LUMPNAME_T_LASTINDEX && src->name[nameLen])
{ nameLen++; }

Str_Clear(&absPath);
for(j = 0; j < LUMPNAME_T_LASTINDEX; ++j)
for(j = 0; j < nameLen; ++j)
{
/// The Hexen demo on Mac uses the 0x80 on some lumps, maybe has significance?
/// @todo Ensure that this doesn't break other IWADs. The 0x80-0xff
Expand Down

0 comments on commit b25d997

Please sign in to comment.