1 point, many points

This commit is contained in:
def 2014-02-25 19:55:35 +01:00
parent 6406e77e9c
commit 3b8645ae98

View file

@ -509,7 +509,10 @@ void CSqlScore::MapPointsThread(void *pUser)
char aServer[32]; char aServer[32];
strcpy(aServer, pData->m_pSqlData->m_pResults->getString("Server").c_str()); strcpy(aServer, pData->m_pSqlData->m_pResults->getString("Server").c_str());
aServer[0] = toupper(aServer[0]); aServer[0] = toupper(aServer[0]);
str_format(aBuf, sizeof(aBuf), "\"%s\" on %s (%d points)", aMap, aServer, points); if (points == 1)
str_format(aBuf, sizeof(aBuf), "\"%s\" on %s (%d point)", aMap, aServer, points);
else
str_format(aBuf, sizeof(aBuf), "\"%s\" on %s (%d points)", aMap, aServer, points);
} }
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf); pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
@ -559,7 +562,10 @@ void CSqlScore::SaveScoreThread(void *pUser)
{ {
pData->m_pSqlData->m_pResults->next(); pData->m_pSqlData->m_pResults->next();
int points = (int)pData->m_pSqlData->m_pResults->getInt("Points"); int points = (int)pData->m_pSqlData->m_pResults->getInt("Points");
str_format(aBuf, sizeof(aBuf), "You earned %d points for finishing this map!", points); if (points == 1)
str_format(aBuf, sizeof(aBuf), "You earned %d point for finishing this map!", points);
else
str_format(aBuf, sizeof(aBuf), "You earned %d points for finishing this map!", points);
pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf); pData->m_pSqlData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf);
} }
} }