From 3033fbb4666da2d6cdafb946a0e2d63966de2083 Mon Sep 17 00:00:00 2001 From: def Date: Sun, 21 Jan 2018 19:13:20 +0100 Subject: [PATCH] Also pass negative numbers --- src/game/server/ddracechat.cpp | 6 +++--- src/game/server/score/sql_score.cpp | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 096d05146..09e315ea7 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -367,7 +367,7 @@ void CGameContext::ConTeamTop5(IConsole::IResult *pResult, void *pUserData) return; } - if (pResult->NumArguments() > 0 && pResult->GetInteger(0) > 0) + if (pResult->NumArguments() > 0) pSelf->Score()->ShowTeamTop5(pResult, pResult->m_ClientID, pUserData, pResult->GetInteger(0)); else @@ -398,7 +398,7 @@ void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData) return; } - if (pResult->NumArguments() > 0 && pResult->GetInteger(0) > 0) + if (pResult->NumArguments() > 0) pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData, pResult->GetInteger(0)); else @@ -1414,7 +1414,7 @@ void CGameContext::ConTopPoints(IConsole::IResult *pResult, void *pUserData) return; } - if (pResult->NumArguments() > 0 && pResult->GetInteger(0) >= 0) + if (pResult->NumArguments() > 0) pSelf->Score()->ShowTopPoints(pResult, pResult->m_ClientID, pUserData, pResult->GetInteger(0)); else diff --git a/src/game/server/score/sql_score.cpp b/src/game/server/score/sql_score.cpp index 79ddfdcb4..e5f5144f5 100644 --- a/src/game/server/score/sql_score.cpp +++ b/src/game/server/score/sql_score.cpp @@ -1075,7 +1075,7 @@ bool CSqlScore::ShowTimesThread(CSqlServer* pSqlServer, const CSqlData *pGameDat return true; int LimitStart = abs(pData->m_Num-1); - const char *pOrder = pData->m_Num >= 0 ? "ASC" : "DESC"; + const char *pOrder = pData->m_Num >= 0 ? "DESC" : "ASC"; try { @@ -1095,8 +1095,7 @@ bool CSqlScore::ShowTimesThread(CSqlServer* pSqlServer, const CSqlData *pGameDat return true; } - str_format(aBuf, sizeof(aBuf), "------------ Last Times No %d - %d ------------", pData->m_Num, pData->m_Num + (int)pSqlServer->GetResults()->rowsCount() - 1); - pData->GameServer()->SendChatTarget(pData->m_ClientID, aBuf); + pData->GameServer()->SendChatTarget(pData->m_ClientID, "------------- Last Times -------------"); float pTime = 0; int pSince = 0;