Fix Discord SOC menus erroring out as Discord RPC defines disables the enums, making them impossible to get parsed.

This commit is contained in:
Nicomedia 2026-03-08 19:24:29 +01:00
parent 9ca702dce8
commit 794d59e52e
2 changed files with 23 additions and 0 deletions

View file

@ -2063,6 +2063,17 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
}
else if (fastcmp(word, "SUBMENU"))
{
#ifndef HAVE_DISCORDRPC
{
const char *testname = word2;
if (fastncmp("MN_", testname, 3))
testname += 3;
if (fastcmp(testname, "OP_DISCORD") || fastcmp(testname, "MISC_DISCORDREQUESTS"))
{
continue;
}
}
#endif
menutype_t mn = get_menutype(word2);
if (mn == MAXMENUTYPES)
{

View file

@ -675,6 +675,18 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
continue; // dedis don't need menus, silly!
}
#ifndef HAVE_DISCORDRPC
{
const char *testname = word2;
if (fastncmp("MN_", testname, 3))
testname += 3;
if (fastcmp(testname, "OP_DISCORD") || fastcmp(testname, "MISC_DISCORDREQUESTS"))
{
ignoremenulines(f);
continue;
}
}
#endif
if (i == 0 && word2[0] != '0') // If word2 isn't a number
i = get_menutype(word2); // find a huditem by name
if (i >= 1 && i < nummenutypes)