diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 10fbe3d95..b4fe91dce 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,8 @@ June 10, 2009 +- Changed wad namespacing so that wads with a missing end marker will be + loaded as if they had one more lump with that end marker. This matches the + behaviour of previously released ZDooms. (The warning is still present, so + there's no excuse to release more wads like this.) - Moved Raw Input processing into a seperate method of FInputDevice so that all the devices can share the same setup code. diff --git a/src/resourcefiles/file_wad.cpp b/src/resourcefiles/file_wad.cpp index 6ee0e22cb..1df3ef2ac 100644 --- a/src/resourcefiles/file_wad.cpp +++ b/src/resourcefiles/file_wad.cpp @@ -224,7 +224,7 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name i++; continue; } - // same for x_START markers + // same for x_END markers while (i < markers.Size()-1 && (markers[i].markertype == 1 && markers[i+1].markertype == 1)) { Printf(TEXTCOLOR_YELLOW"WARNING: duplicate %s marker found.\n", endmarker); @@ -235,13 +235,16 @@ void FWadFile::SetNamespace(const char *startmarker, const char *endmarker, name if (i >= markers.Size()) { Printf(TEXTCOLOR_YELLOW"WARNING: %s marker without corresponding %s found.\n", startmarker, endmarker); - return; + end = NumLumps; + } + else + { + end = markers[i++].index; } - end = i++; // we found a marked block - DPrintf("Found %s block at (%d-%d)\n", startmarker, markers[start].index, markers[end].index); - for(int j = markers[start].index+1; j < markers[end].index; j++) + DPrintf("Found %s block at (%d-%d)\n", startmarker, markers[start].index, end); + for(int j = markers[start].index + 1; j < end; j++) { if (Lumps[j].Namespace != ns_global) {