Fix to the netplay_is_alive function when server isn't playing

Fixes a bug by which very strange things would happen if the server went
to spectator mode with exactly one connected client.
This commit is contained in:
Gregor Richards 2017-01-02 20:03:00 -05:00
parent 6bd212a6ce
commit 20c0de352c

View File

@ -50,7 +50,8 @@ static bool netplay_is_alive(void)
{
if (!netplay_data)
return false;
return !!netplay_data->connected_players;
return (netplay_data->is_server && !!netplay_data->connected_players) ||
(!netplay_data->is_server && netplay_data->self_mode >= NETPLAY_CONNECTION_CONNECTED);
}
/**