From ebdd9b8b7e52426db7bdde165628e74d11f07460 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 25 Aug 2025 22:46:10 +0100 Subject: [PATCH] W_VerifyNMUSlumps: Rewind back to beginning of file handle for WAD --- src/w_wad.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/w_wad.cpp b/src/w_wad.cpp index efbc752cc..47f48a0af 100644 --- a/src/w_wad.cpp +++ b/src/w_wad.cpp @@ -2437,7 +2437,9 @@ int W_VerifyNMUSlumps(const char *filename, FILE *handle, boolean exit_on_error) int status = 0; if (stricmp(&filename[strlen(filename) - 4], ".pk3") == 0) + { status = W_VerifyPK3(handle, NMUSlist, false); + } else { // detect wad file by the absence of the other supported extensions @@ -2445,6 +2447,9 @@ int W_VerifyNMUSlumps(const char *filename, FILE *handle, boolean exit_on_error) && stricmp(&filename[strlen(filename) - 4], ".lua")) { status = W_VerifyWAD(handle, NMUSlist, false); + + // repair file handle in this specific case + fseek(handle, 0, SEEK_SET); } }