diff --git a/src/d_main.c b/src/d_main.c index 1300b74d9..dc67d89bc 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1072,8 +1072,7 @@ static void D_FindAddonsToAutoload(void) const char *autoloadpath; boolean postload; - INT32 i, len; - boolean hasprefix = false; + INT32 i; char wadsToAutoload[256] = ""; // does it exist tho @@ -1107,34 +1106,12 @@ static void D_FindAddonsToAutoload(void) wadsToAutoload[i] = '\0'; } - len = strlen(wadsToAutoload); - hasprefix = false; + CONS_Printf("file %s = %d\n", wadsToAutoload, W_CheckPostLoadList(wadsToAutoload)); - for (i = 0; i < len; ++i) + if (W_CheckPostLoadList(wadsToAutoload)) { - if (wadsToAutoload[i] == '_') - { - hasprefix = true; - break; - } - } - - // Lets just hope no one adds bonuschars in autoload - if (hasprefix) - { - // We searching for c in prefix, which stands for "character" and doesn't work well with - // autoload atm, only fine for postload - for (i = 0; i < len; ++i) - { - if (wadsToAutoload[i] == '_') break; // Prefix end - - if (wadsToAutoload[i] == 'c' || wadsToAutoload[i] == 'C') - { - CONS_Alert(CONS_WARNING, "forcing postload for %s as local skin\n", wadsToAutoload); - postload = true; - break; // Found it - } - } + CONS_Printf("forcing postload for file %s\n", wadsToAutoload); + postload = true; } // LOAD IT diff --git a/src/w_wad.c b/src/w_wad.c index a24686e28..e24eefa87 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -2120,6 +2120,25 @@ int W_VerifyNMUSlumps(const char *filename) return W_VerifyFile(filename, NMUSlist, false); } +int W_CheckPostLoadList(const char *filename) +{ + static lumpchecklist_t postloadlist[] = + { + {"Lua/", 4}, + {"SOC/", 4}, + {"Skins/", 6}, + {"S_SKIN", 6}, + {"LUA_", 4}, + {"SOC_", 4}, + {"MAINCFG", 7}, + {"OBJCTCFG", 8}, + {"MAP", 3}, + + {NULL, 0}, + }; + return W_VerifyFile(filename, postloadlist, true); +} + /** \brief Generates a virtual resource used for level data loading. * * \param lumpnum_t reference diff --git a/src/w_wad.h b/src/w_wad.h index 4e84ea0e4..fd2038db2 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -226,4 +226,6 @@ void W_VerifyFileMD5(UINT16 wadfilenum, const char *matchmd5); int W_VerifyNMUSlumps(const char *filename); +int W_CheckPostLoadList(const char *filename); + #endif // __W_WAD__