Fix UNSTABLE_BRANCH checking
This commit is contained in:
parent
bc7ec31c02
commit
05fd683c64
|
@ -7,6 +7,7 @@
|
||||||
#include <ultra64.h>
|
#include <ultra64.h>
|
||||||
#include "macros.h"
|
#include "macros.h"
|
||||||
#include "src/game/characters.h"
|
#include "src/game/characters.h"
|
||||||
|
#include "pc/network/version.h"
|
||||||
|
|
||||||
// Certain functions are marked as having return values, but do not
|
// Certain functions are marked as having return values, but do not
|
||||||
// actually return a value. This causes undefined behavior, which we'd rather
|
// actually return a value. This causes undefined behavior, which we'd rather
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "discord_network.h"
|
#include "discord_network.h"
|
||||||
#include "pc/debuglog.h"
|
#include "pc/debuglog.h"
|
||||||
#include "menu/custom_menu_system.h"
|
#include "menu/custom_menu_system.h"
|
||||||
|
#include "pc/network/version.h"
|
||||||
|
|
||||||
#if defined(_WIN32) || defined(_WIN64)
|
#if defined(_WIN32) || defined(_WIN64)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -128,6 +129,14 @@ static bool ns_discord_initialize(enum NetworkType networkType) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
set_instance_env_variable();
|
set_instance_env_variable();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef UNSTABLE_BRANCH
|
||||||
|
if (networkType != NT_NONE) {
|
||||||
|
// refuse to host on discord for unstable branch
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!gDiscordInitialized) {
|
if (!gDiscordInitialized) {
|
||||||
// set up discord params
|
// set up discord params
|
||||||
struct DiscordCreateParams params;
|
struct DiscordCreateParams params;
|
||||||
|
@ -142,10 +151,6 @@ static bool ns_discord_initialize(enum NetworkType networkType) {
|
||||||
int rc = DiscordCreate(DISCORD_VERSION, ¶ms, &app.core);
|
int rc = DiscordCreate(DISCORD_VERSION, ¶ms, &app.core);
|
||||||
gDiscordFailed = false;
|
gDiscordFailed = false;
|
||||||
if (networkType != NT_NONE) {
|
if (networkType != NT_NONE) {
|
||||||
#ifdef UNSTABLE_BRANCH
|
|
||||||
// refuse to host on discord for unstable branch
|
|
||||||
exit(1);
|
|
||||||
#endif
|
|
||||||
DISCORD_REQUIRE(rc);
|
DISCORD_REQUIRE(rc);
|
||||||
} else if (rc) {
|
} else if (rc) {
|
||||||
LOG_ERROR("DiscordCreate failed: %d", rc);
|
LOG_ERROR("DiscordCreate failed: %d", rc);
|
||||||
|
|
Loading…
Reference in New Issue