This commit is contained in:
Agent X 2023-12-07 18:54:04 -05:00
parent 4e63798f00
commit c77d72eceb
2 changed files with 11 additions and 7 deletions

View File

@ -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) {

View File

@ -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) {