Moving around netplay disable/enable to make sure mode switches work

properly.
This commit is contained in:
Gregor Richards 2016-10-03 17:40:14 -04:00
parent 3953018547
commit ff8590b151

View File

@ -3277,8 +3277,6 @@ static int action_ok_netplay_enable_host(const char *path,
bool netplay_was_on = false; bool netplay_was_on = false;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_SERVER, NULL);
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL)) if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
{ {
netplay_was_on = true; netplay_was_on = true;
@ -3287,6 +3285,8 @@ static int action_ok_netplay_enable_host(const char *path,
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
} }
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_SERVER, NULL);
/* If we haven't yet started, this will load on its own */ /* If we haven't yet started, this will load on its own */
if (!content_is_inited()) if (!content_is_inited())
{ {
@ -3319,8 +3319,6 @@ static int action_ok_netplay_enable_client(const char *path,
bool netplay_was_on = false; bool netplay_was_on = false;
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL)) if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
{ {
netplay_was_on = true; netplay_was_on = true;
@ -3329,6 +3327,8 @@ static int action_ok_netplay_enable_client(const char *path,
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
} }
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
/* We can't do anything without a host specified */ /* We can't do anything without a host specified */
if (!settings->netplay.server[0]) if (!settings->netplay.server[0])
{ {