diff --git a/src/game/server/score/sql_score.cpp b/src/game/server/score/sql_score.cpp index d2cf46fb8..778d275a9 100644 --- a/src/game/server/score/sql_score.cpp +++ b/src/game/server/score/sql_score.cpp @@ -1584,13 +1584,6 @@ void CSqlScore::RandomUnfinishedMap(int ClientID, int stars) void CSqlScore::SaveTeam(int Team, const char* Code, int ClientID, const char* Server) { - CSqlTeamSave *Tmp = new CSqlTeamSave(); - Tmp->m_Team = Team; - Tmp->m_ClientID = ClientID; - str_copy(Tmp->m_Code, Code, 32); - str_copy(Tmp->m_Server, Server, sizeof(Tmp->m_Server)); - Tmp->m_pSqlData = this; - if((g_Config.m_SvTeam == 3 || (Team > 0 && Team < MAX_CLIENTS)) && ((CGameControllerDDRace*)(GameServer()->m_pController))->m_Teams.Count(Team) > 0) { if(((CGameControllerDDRace*)(GameServer()->m_pController))->m_Teams.GetSaving(Team)) @@ -1603,6 +1596,13 @@ void CSqlScore::SaveTeam(int Team, const char* Code, int ClientID, const char* S return; } + CSqlTeamSave *Tmp = new CSqlTeamSave(); + Tmp->m_Team = Team; + Tmp->m_ClientID = ClientID; + str_copy(Tmp->m_Code, Code, 32); + str_copy(Tmp->m_Server, Server, sizeof(Tmp->m_Server)); + Tmp->m_pSqlData = this; + void *SaveThread = thread_create(SaveTeamThread, Tmp); #if defined(CONF_FAMILY_UNIX) pthread_detach((pthread_t)SaveThread);