mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-09 17:48:19 +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
|
||||
{
|
||||
// get the name of the map without his path
|
||||
const char *pMapShortName = &Config()->m_SvMap[0];
|
||||
for(int i = 0; i < str_length(Config()->m_SvMap) - 1; i++)
|
||||
const char *pMapName = m_aCurrentMap;
|
||||
const char *pMapShortName = pMapName;
|
||||
for(int i = 0; i < str_length(pMapName) - 1; i++)
|
||||
{
|
||||
if(Config()->m_SvMap[i] == '/' || Config()->m_SvMap[i] == '\\')
|
||||
pMapShortName = &Config()->m_SvMap[i + 1];
|
||||
if(pMapName[i] == '/' || pMapName[i] == '\\')
|
||||
pMapShortName = &pMapName[i + 1];
|
||||
}
|
||||
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);
|
||||
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_aClientName, this->Server()->ClientName(ClientID), sizeof(Tmp->m_aClientName));
|
||||
Tmp->m_aGeneratedCode[0] = '\0';
|
||||
|
|
Loading…
Reference in a new issue