Make sure coopnet always sets callbacks

This commit is contained in:
MysterD 2023-04-13 23:39:00 -07:00
parent 1631744dca
commit a6d98d3103
1 changed files with 2 additions and 1 deletions

View File

@ -127,7 +127,6 @@ static void ns_coopnet_shutdown(void) {
}
static CoopNetRc coopnet_initialize(void) {
if (coopnet_is_connected()) { return COOPNET_OK; }
gCoopNetCallbacks.OnConnected = coopnet_on_connected;
gCoopNetCallbacks.OnDisconnected = coopnet_on_disconnected;
@ -136,6 +135,8 @@ static CoopNetRc coopnet_initialize(void) {
gCoopNetCallbacks.OnLobbyLeft = coopnet_on_lobby_left;
gCoopNetCallbacks.OnPeerDisconnected = coopnet_on_peer_disconnected;
if (coopnet_is_connected()) { return COOPNET_OK; }
CoopNetRc rc = coopnet_begin(configCoopNetIp, configCoopNetPort);
if (rc == COOPNET_FAILED) {
djui_popup_create(DLANG(NOTIF, COOPNET_CONNECTION_FAILED), 2);