mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2277
2277: Minor code style fixes in sql_score.cpp r=Learath2 a=def- Co-authored-by: def <dennis@felsin9.de>
This commit is contained in:
commit
59e300903b
|
@ -612,17 +612,14 @@ bool CSqlScore::SaveScoreThread(CSqlServer* pSqlServer, const CSqlData<CSqlPlaye
|
|||
int NumFinished = pSqlServer->GetResults()->getInt("NumFinished");
|
||||
if(NumFinished == 0)
|
||||
{
|
||||
str_format(aBuf, sizeof(aBuf), "SELECT Points FROM %s_maps WHERE Map ='%s'", pSqlServer->GetPrefix(), pData->m_Map.ClrStr());
|
||||
str_format(aBuf, sizeof(aBuf), "SELECT Points FROM %s_maps WHERE Map='%s'", pSqlServer->GetPrefix(), pData->m_Map.ClrStr());
|
||||
pSqlServer->executeSqlQuery(aBuf);
|
||||
|
||||
if(pSqlServer->GetResults()->rowsCount() == 1)
|
||||
{
|
||||
pSqlServer->GetResults()->next();
|
||||
int Points = pSqlServer->GetResults()->getInt("Points");
|
||||
if(Points == 1)
|
||||
str_format(paMessages[0], sizeof(paMessages[0]), "You earned %d point for finishing this map!", Points);
|
||||
else
|
||||
str_format(paMessages[0], sizeof(paMessages[0]), "You earned %d points for finishing this map!", Points);
|
||||
str_format(paMessages[0], sizeof(paMessages[0]), "You earned %d point%s for finishing this map!", Points, Points == 1 ? "" : "s");
|
||||
|
||||
str_format(aBuf, sizeof(aBuf),
|
||||
"INSERT INTO %s_points(Name, Points) "
|
||||
|
|
Loading…
Reference in a new issue