diff --git a/src/d_main.c b/src/d_main.c index 34209e32a..a2b4c042a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1234,9 +1234,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 1c6fa0087..8015a30da 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2587,6 +2587,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[] = @@ -2599,7 +2611,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 fc7f25fec..ea4a98dd6 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -241,6 +241,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