diff --git a/src/engine/client/serverbrowser.cpp b/src/engine/client/serverbrowser.cpp index 6c93b3aba..b2c91dfab 100644 --- a/src/engine/client/serverbrowser.cpp +++ b/src/engine/client/serverbrowser.cpp @@ -1468,15 +1468,21 @@ void CServerBrowser::LoadDDNetServers() const json_value &IconUrl = Icon["url"]; const json_value &Name = Community["name"]; const json_value HasFinishes = Community["has_finishes"]; - const json_value *pFinishes = &Icon["finishes"]; + const json_value *pFinishes = &Community["finishes"]; const json_value *pServers = &Community["servers"]; - // We accidentally set servers to be part of icon, so support that as a - // fallback for now. Can be removed in a few versions when the - // communities.json has been updated. + // We accidentally set finishes/servers to be part of icon in + // the past, so support that, too. Can be removed once we make + // a breaking change to the whole thing, necessitating a new + // endpoint. + if(pFinishes->type == json_none) + { + pServers = &Icon["finishes"]; + } if(pServers->type == json_none) { pServers = &Icon["servers"]; } + // Backward compatibility. if(pFinishes->type == json_none) { if(str_comp(Id, COMMUNITY_DDNET) == 0) @@ -1484,7 +1490,6 @@ void CServerBrowser::LoadDDNetServers() pFinishes = &(*m_pDDNetInfo)["maps"]; } } - // Backward compatibility. if(pServers->type == json_none) { if(str_comp(Id, COMMUNITY_DDNET) == 0)