diff --git a/include/types.h b/include/types.h index 3207bbdcb..5c08c8f2e 100644 --- a/include/types.h +++ b/include/types.h @@ -7,6 +7,7 @@ #include #include "macros.h" #include "src/game/characters.h" +#include "pc/network/version.h" // Certain functions are marked as having return values, but do not // actually return a value. This causes undefined behavior, which we'd rather diff --git a/src/pc/network/discord/discord.c b/src/pc/network/discord/discord.c index eef2e76f9..c598cd77a 100644 --- a/src/pc/network/discord/discord.c +++ b/src/pc/network/discord/discord.c @@ -5,6 +5,7 @@ #include "discord_network.h" #include "pc/debuglog.h" #include "menu/custom_menu_system.h" +#include "pc/network/version.h" #if defined(_WIN32) || defined(_WIN64) #include @@ -128,6 +129,14 @@ static bool ns_discord_initialize(enum NetworkType networkType) { #ifdef DEBUG set_instance_env_variable(); #endif + +#ifdef UNSTABLE_BRANCH + if (networkType != NT_NONE) { + // refuse to host on discord for unstable branch + exit(1); + } +#endif + if (!gDiscordInitialized) { // set up discord params struct DiscordCreateParams params; @@ -142,10 +151,6 @@ static bool ns_discord_initialize(enum NetworkType networkType) { int rc = DiscordCreate(DISCORD_VERSION, ¶ms, &app.core); gDiscordFailed = false; if (networkType != NT_NONE) { -#ifdef UNSTABLE_BRANCH - // refuse to host on discord for unstable branch - exit(1); -#endif DISCORD_REQUIRE(rc); } else if (rc) { LOG_ERROR("DiscordCreate failed: %d", rc);