From 2c5f23bacb387d000a3a93eddb764b1a4c3789b5 Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Fri, 21 Aug 2020 03:30:22 -0500 Subject: [PATCH 1/2] Fix a bug where adding the same mod multiple times counted to the mod limit A one line fix. Seriously. --- src/w_wad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/w_wad.c b/src/w_wad.c index 548d1bc00..701820b2f 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -776,6 +776,7 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) if (!memcmp(wadfiles[i]->md5sum, md5sum, 16)) { CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename); + packetsizetally -= nameonlylength(filename) + 22; if (handle) fclose(handle); return W_InitFileError(filename, false); From d15be1696af61ac35346e1ba4f08cb7d6782c36d Mon Sep 17 00:00:00 2001 From: GoldenTails Date: Fri, 21 Aug 2020 04:00:54 -0500 Subject: [PATCH 2/2] Forgot to check if the file was important, whoops! --- src/w_wad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/w_wad.c b/src/w_wad.c index 701820b2f..3a1b17db8 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -776,7 +776,8 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) if (!memcmp(wadfiles[i]->md5sum, md5sum, 16)) { CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename); - packetsizetally -= nameonlylength(filename) + 22; + if (important) + packetsizetally -= nameonlylength(filename) + 22; if (handle) fclose(handle); return W_InitFileError(filename, false);