From 5577ba4c7ac98cb11339f4b416801ac100430c82 Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 1 Mar 2026 00:03:19 +0100 Subject: [PATCH] Autoload: dont add wads that contain maps --- src/d_main.c | 11 ++++++++++- src/w_wad.c | 13 ++++++++++++- src/w_wad.h | 1 + 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 2832d6c6a..1a03b1972 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1124,9 +1124,18 @@ static void D_FindAddonsToAutoload(void) if (newline) *newline = '\0'; + // ok so theres still issues with players adding stuff to autoload by accident + // sometimes this stuff contains maps + // you can probably imagine how that goes in a netgame.... + if (W_CheckAutoLoadContainsMap(wadsToAutoload)) + { + CONS_Printf("Autoload: file %s contains map data! skipping...", wadsToAutoload); + continue; + } + if (!postload && W_CheckPostLoadList(wadsToAutoload)) { - CONS_Printf("forcing postload for file %s\n", wadsToAutoload); + CONS_Printf("Autoload: forcing postload for file %s\n", wadsToAutoload); postload = true; } diff --git a/src/w_wad.c b/src/w_wad.c index 8cc3fd214..4a1c1247a 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2576,6 +2576,18 @@ static int W_CheckFileContains(const char *filename, lumpchecklist_t *checklist) return contains; } +int W_CheckAutoLoadContainsMap(const char *filename) +{ + // for now this checks for map marker + static lumpchecklist_t autoloadblacklist[] = + { + {"MAP", 3}, + {NULL, 0}, + }; + + return W_CheckFileContains(filename, autoloadblacklist); +} + int W_CheckPostLoadList(const char *filename) { static lumpchecklist_t postloadlist[] = @@ -2588,7 +2600,6 @@ int W_CheckPostLoadList(const char *filename) {"SOC_", 4}, {"MAINCFG", 7}, {"OBJCTCFG", 8}, - {"MAP", 3}, {NULL, 0}, }; diff --git a/src/w_wad.h b/src/w_wad.h index 6240c31f3..98c57173e 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -243,6 +243,7 @@ void W_VerifyFileMD5(UINT16 wadfilenum, const char *matchmd5); int W_VerifyNMUSlumps(const char *filename, FILE *handle, boolean exit_on_error); +int W_CheckAutoLoadContainsMap(const char *filename); int W_CheckPostLoadList(const char *filename); #ifdef __cplusplus