mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Last one I hope
This commit is contained in:
parent
ffe9235151
commit
a8cadc21eb
|
@ -622,16 +622,28 @@ void CGameContext::ConSave(IConsole::IResult *pResult, void *pUserData)
|
|||
int Team = ((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(pResult->m_ClientID);
|
||||
|
||||
const char* pCode = pResult->GetString(0);
|
||||
char aCountry[4];
|
||||
char aCountry[5];
|
||||
if(str_length(pCode) > 3 && pCode[0] >= 'A' && pCode[0] <= 'Z' && pCode[1] >= 'A'
|
||||
&& pCode[1] <= 'Z' && pCode[2] >= 'A' && pCode[2] <= 'Z' && pCode[3] == ' ')
|
||||
&& pCode[1] <= 'Z' && pCode[2] >= 'A' && pCode[2] <= 'Z')
|
||||
{
|
||||
str_copy(aCountry, pCode, 4);
|
||||
pCode = pCode + 4;
|
||||
if(pCode[3] == ' ')
|
||||
{
|
||||
str_copy(aCountry, pCode, 4);
|
||||
pCode = pCode + 4;
|
||||
}
|
||||
else if(str_length(pCode) > 4 && pCode[4] == ' ')
|
||||
{
|
||||
str_copy(aCountry, pCode, 5);
|
||||
pCode = pCode + 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
str_copy(aCountry, g_Config.m_SvSqlServerName, sizeof(aCountry));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
str_copy(aCountry, g_Config.m_SvSqlServerName, 4);
|
||||
str_copy(aCountry, g_Config.m_SvSqlServerName, sizeof(aCountry));
|
||||
}
|
||||
|
||||
pSelf->Score()->SaveTeam(Team, pCode, pResult->m_ClientID, aCountry);
|
||||
|
|
Loading…
Reference in a new issue