about summary refs log tree commit diff
path: root/src/game/server
diff options
context:
space:
mode:
authoroy <Tom_Adams@web.de>2010-10-11 01:06:44 +0200
committeroy <Tom_Adams@web.de>2010-10-11 01:06:44 +0200
commitb65a26fe93e54af74d6304e66ec5942ecf4c48e8 (patch)
treeaa64740d1b09c2744c5bfba5f99cddef702e60c6 /src/game/server
parent8557d3a022cf250628dc8a03bdc26efd0338bc5d (diff)
downloadzcatch-b65a26fe93e54af74d6304e66ec5942ecf4c48e8.tar.gz
zcatch-b65a26fe93e54af74d6304e66ec5942ecf4c48e8.zip
fixed last commits
Diffstat (limited to 'src/game/server')
-rw-r--r--src/game/server/gamecontext.cpp13
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);
 			}
 		}