attempt to check for things in file for postload detection

This commit is contained in:
Alug committed 2024-10-23 02:41:23 +02:00
1 parent 05a98964fb
commit 8b1797927a
3 files changed
+26 -28

No files matched your search

+5 -28
View File
@@ -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
+19
View File
@@ -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
+2
View File
@@ -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__