From c36eb3d359e10958b1eb7f94096a80d3cf7a7024 Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 10 Nov 2010 23:24:33 +0100 Subject: [PATCH] fixed a bug with "me" as victim, fixed kick function due to new victim system --- src/engine/server/server.cpp | 2 +- src/engine/shared/console.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index e7c59c4e2..4e2e59efa 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -1334,7 +1334,7 @@ int CServer::Run() void CServer::ConKick(IConsole::IResult *pResult, void *pUser, int ClientId) { - int ClientId1 = pResult->GetInteger(0); + int ClientId1 = pResult->GetVictim(); char buf[128]; if(ClientId1 < 0 || ClientId1 >= MAX_CLIENTS || ((CServer *)pUser)->m_aClients[ClientId1].m_State == CClient::STATE_EMPTY) { diff --git a/src/engine/shared/console.cpp b/src/engine/shared/console.cpp index b4b881d61..4f2084b23 100644 --- a/src/engine/shared/console.cpp +++ b/src/engine/shared/console.cpp @@ -53,9 +53,10 @@ void CConsole::CResult::SetVictim(const char *pVictim) { if(!str_comp(pVictim, "me")) m_Victim = -2; - if(!str_comp(pVictim, "all")) + else if(!str_comp(pVictim, "all")) m_Victim = -1; - m_Victim = clamp(str_toint(pVictim), 0, MAX_CLIENTS); + else + m_Victim = clamp(str_toint(pVictim), 0, MAX_CLIENTS); }