Merge pull request 'Fix SOC menus erroring out when SRB2_CONFIG_ENABLE_DISCORDRPC is OFF' (#225) from Nicomedia/blankart:discordless into next

Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/225
This commit is contained in:
NepDisk 2026-03-08 23:29:41 +01:00
commit 063a6d3710
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)