From b65a26fe93e54af74d6304e66ec5942ecf4c48e8 Mon Sep 17 00:00:00 2001 From: oy Date: Mon, 11 Oct 2010 01:06:44 +0200 Subject: fixed last commits --- src/game/server/gamecontext.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/game/server') diff --git a/src/game/server/gamecontext.cpp b/src/game/server/gamecontext.cpp index 95a7e558..0faba6fc 100644 --- a/src/game/server/gamecontext.cpp +++ b/src/game/server/gamecontext.cpp @@ -670,21 +670,24 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId) } const char *pReason = "No reason given"; - for(int i = 0; i < str_length(pMsg->m_Value)-1; i++) + for(const char *p = pMsg->m_Value; *p; ++p) { - if(pMsg->m_Value[i] == ' ') - pReason = &pMsg->m_Value[i+1]; + if(*p == ' ') + { + pReason = p+1; + break; + } } str_format(aChatmsg, sizeof(aChatmsg), "'%s' called for vote to kick '%s' (%s)", Server()->ClientName(ClientId), Server()->ClientName(KickId), pReason); str_format(aDesc, sizeof(aDesc), "Kick '%s'", Server()->ClientName(KickId)); if (!g_Config.m_SvVoteKickBantime) - str_format(aCmd, sizeof(aCmd), "kick %d %s", KickId, pReason); + str_format(aCmd, sizeof(aCmd), "kick %d \"Kicked by vote\"", KickId); else { char aBuf[64] = {0}; Server()->GetClientIP(KickId, aBuf, sizeof(aBuf)); - str_format(aCmd, sizeof(aCmd), "ban %s %d %s", aBuf, g_Config.m_SvVoteKickBantime, pReason); + str_format(aCmd, sizeof(aCmd), "ban %s %d \"Banned by vote\"", aBuf, g_Config.m_SvVoteKickBantime); } } -- cgit 1.4.1