Fixed #77. top5

This commit is contained in:
GreYFoX 2011-08-31 12:30:18 +02:00
parent 7e24be5d83
commit 3ad8284716
3 changed files with 8 additions and 11 deletions

View file

@ -377,8 +377,8 @@ CConsole::CCommand *CConsole::FindCommand(const char *pName, int FlagMask)
void CConsole::ExecuteLine(const char *pStr, int ClientID)
{
CConsole::ExecuteLineStroked(1, pStr); // press it
CConsole::ExecuteLineStroked(0, pStr); // then release it
CConsole::ExecuteLineStroked(1, pStr, ClientID); // press it
CConsole::ExecuteLineStroked(0, pStr, ClientID); // then release it
}

View file

@ -249,10 +249,6 @@ void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData)
CGameContext *pSelf = (CGameContext *)pUserData;
if(!CheckClientID(pResult->m_ClientID)) return;
CPlayer *pPlayer = pSelf->m_apPlayers[pResult->m_ClientID];
if(!pPlayer)
return;
if(g_Config.m_SvHideScore)
{
pSelf->SendChatTarget(pResult->m_ClientID,"Showing the top 5 is not allowed on this server.");
@ -260,10 +256,11 @@ void CGameContext::ConTop5(IConsole::IResult *pResult, void *pUserData)
}
if(pResult->NumArguments() > 0)
pSelf->Score()->ShowTop5(pResult, pPlayer->GetCID(), pUserData, pResult->GetInteger(0));
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData, pResult->GetInteger(0));
else
pSelf->Score()->ShowTop5(pResult, pPlayer->GetCID(), pUserData);
pSelf->Score()->ShowTop5(pResult, pResult->m_ClientID, pUserData);
}
#if defined(CONF_SQL)
void CGameContext::ConTimes(IConsole::IResult *pResult, void *pUserData)
{

View file

@ -205,7 +205,7 @@ void CFileScore::ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserD
{
CGameContext *pSelf = (CGameContext *)pUserData;
char aBuf[512];
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "top5", "----------- Top 5 -----------");
pSelf->SendChatTarget(ClientID, "----------- Top 5 -----------");
for(int i = 0; i < 5; i++)
{
if(i+Debut > m_Top.size())
@ -213,9 +213,9 @@ void CFileScore::ShowTop5(IConsole::IResult *pResult, int ClientID, void *pUserD
CPlayerScore *r = &m_Top[i+Debut-1];
str_format(aBuf, sizeof(aBuf), "%d. %s Time: %d minute(s) %5.2f second(s)",
i+Debut, r->m_aName, (int) r->m_Score/60, r->m_Score-((int)r->m_Score/60*60));
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "top5", aBuf);
pSelf->SendChatTarget(ClientID, aBuf);
}
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "top5", "------------------------------");
pSelf->SendChatTarget(ClientID, "------------------------------");
}
void CFileScore::ShowRank(int ClientID, const char* pName, bool Search)