diff --git a/src/pc/discord/discord_activity.c b/src/pc/discord/discord_activity.c index 0c4b1ed2..e22a6a35 100644 --- a/src/pc/discord/discord_activity.c +++ b/src/pc/discord/discord_activity.c @@ -78,10 +78,13 @@ static void discord_populate_details(char* buffer, int bufferLength) { bufferLength -= versionLength; // get mod strings - if (gActiveMods.entryCount <= 0) { return; } - char* strings[gActiveMods.entryCount]; + u8 autoexecMod = mods_has_autoexec_mod(); + if (gActiveMods.entryCount - autoexecMod <= 0) { return; } + char* strings[gActiveMods.entryCount - autoexecMod]; for (int i = 0; i < gActiveMods.entryCount; i++) { - strings[i] = gActiveMods.entries[i]->name; + struct Mod* mod = gActiveMods.entries[i]; + if (mod_get_is_autoexec(mod)) { continue; } + strings[i] = mod->name; } // add seperator @@ -90,7 +93,7 @@ static void discord_populate_details(char* buffer, int bufferLength) { bufferLength -= 3; // concat mod strings - str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount, ", "); + str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount - autoexecMod, ", "); } void discord_activity_update(void) { diff --git a/src/pc/network/coopnet/coopnet.c b/src/pc/network/coopnet/coopnet.c index a6dd6b92..e831a2f3 100644 --- a/src/pc/network/coopnet/coopnet.c +++ b/src/pc/network/coopnet/coopnet.c @@ -180,8 +180,9 @@ static void coopnet_populate_description(void) { bufferLength -= versionLength; // get mod strings - if (gActiveMods.entryCount <= 0) { return; } - char* strings[gActiveMods.entryCount - mods_has_autoexec_mod()]; + u8 autoexecMod = mods_has_autoexec_mod(); + if (gActiveMods.entryCount - autoexecMod <= 0) { return; } + char* strings[gActiveMods.entryCount - autoexecMod]; for (int i = 0; i < gActiveMods.entryCount; i++) { struct Mod* mod = gActiveMods.entries[i]; if (mod_get_is_autoexec(mod)) { continue; } @@ -195,7 +196,7 @@ static void coopnet_populate_description(void) { bufferLength -= strlen(sep); // concat mod strings - str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount, "\\#dcdcdc\\\n"); + str_seperator_concat(buffer, bufferLength, strings, gActiveMods.entryCount - autoexecMod, "\\#dcdcdc\\\n"); } void ns_coopnet_update(void) {