diff options
Diffstat (limited to 'src/game/server/gamecontext.cpp')
| -rw-r--r-- | src/game/server/gamecontext.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
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); } } |