mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 22:18:19 +00:00
Also search for maps with sha256 in downloadedmaps
Additionally, forget the extra map details after disconnecting, they shouldn't be used for the next server.
This commit is contained in:
parent
ca8fcc823c
commit
ab55bcd9c8
|
@ -754,6 +754,7 @@ void CClient::DisconnectWithReason(const char *pReason)
|
|||
m_MapdownloadCrc = 0;
|
||||
m_MapdownloadTotalsize = -1;
|
||||
m_MapdownloadAmount = 0;
|
||||
m_MapDetailsPresent = false;
|
||||
|
||||
// clear the current server info
|
||||
mem_zero(&m_CurrentServerInfo, sizeof(m_CurrentServerInfo));
|
||||
|
@ -1135,6 +1136,15 @@ const char *CClient::LoadMapSearch(const char *pMapName, SHA256_DIGEST *pWantedS
|
|||
return pError;
|
||||
|
||||
// try the downloaded maps
|
||||
if(pWantedSha256)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "downloadedmaps/%s_%08x_%s.map", pMapName, WantedCrc, aWantedSha256);
|
||||
pError = LoadMap(pMapName, aBuf, pWantedSha256, WantedCrc);
|
||||
if(!pError)
|
||||
return pError;
|
||||
}
|
||||
|
||||
// try the downloaded maps folder without appending the sha256
|
||||
str_format(aBuf, sizeof(aBuf), "downloadedmaps/%s_%08x.map", pMapName, WantedCrc);
|
||||
pError = LoadMap(pMapName, aBuf, pWantedSha256, WantedCrc);
|
||||
if(!pError)
|
||||
|
|
Loading…
Reference in a new issue