mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-19 17:14:18 +00:00
fix map name being updated before OnMapChange(...)
call
This commit is contained in:
parent
deae4ff920
commit
f74ebfe3e8
|
@ -2504,11 +2504,12 @@ void CServer::PumpNetwork(bool PacketWaiting)
|
||||||
const char *CServer::GetMapName() const
|
const char *CServer::GetMapName() const
|
||||||
{
|
{
|
||||||
// get the name of the map without his path
|
// get the name of the map without his path
|
||||||
const char *pMapShortName = &Config()->m_SvMap[0];
|
const char *pMapName = m_aCurrentMap;
|
||||||
for(int i = 0; i < str_length(Config()->m_SvMap) - 1; i++)
|
const char *pMapShortName = pMapName;
|
||||||
|
for(int i = 0; i < str_length(pMapName) - 1; i++)
|
||||||
{
|
{
|
||||||
if(Config()->m_SvMap[i] == '/' || Config()->m_SvMap[i] == '\\')
|
if(pMapName[i] == '/' || pMapName[i] == '\\')
|
||||||
pMapShortName = &Config()->m_SvMap[i + 1];
|
pMapShortName = &pMapName[i + 1];
|
||||||
}
|
}
|
||||||
return pMapShortName;
|
return pMapShortName;
|
||||||
}
|
}
|
||||||
|
|
|
@ -300,7 +300,7 @@ void CScore::SaveTeam(int ClientID, const char *pCode, const char *pServer, bool
|
||||||
|
|
||||||
auto Tmp = std::make_unique<CSqlTeamSave>(SaveResult);
|
auto Tmp = std::make_unique<CSqlTeamSave>(SaveResult);
|
||||||
str_copy(Tmp->m_aCode, pCode, sizeof(Tmp->m_aCode));
|
str_copy(Tmp->m_aCode, pCode, sizeof(Tmp->m_aCode));
|
||||||
str_copy(Tmp->m_aMap, g_Config.m_SvMap, sizeof(Tmp->m_aMap));
|
str_copy(Tmp->m_aMap, this->Server()->GetMapName(), sizeof(Tmp->m_aMap));
|
||||||
str_copy(Tmp->m_aServer, pServer, sizeof(Tmp->m_aServer));
|
str_copy(Tmp->m_aServer, pServer, sizeof(Tmp->m_aServer));
|
||||||
str_copy(Tmp->m_aClientName, this->Server()->ClientName(ClientID), sizeof(Tmp->m_aClientName));
|
str_copy(Tmp->m_aClientName, this->Server()->ClientName(ClientID), sizeof(Tmp->m_aClientName));
|
||||||
Tmp->m_aGeneratedCode[0] = '\0';
|
Tmp->m_aGeneratedCode[0] = '\0';
|
||||||
|
|
Loading…
Reference in a new issue