fixed a bug with "me" as victim, fixed kick function due to new victim system

This commit is contained in:
heinrich5991 2010-11-10 23:24:33 +01:00
parent 40eade2021
commit c36eb3d359
2 changed files with 4 additions and 3 deletions

View file

@ -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)
{

View file

@ -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<int>(str_toint(pVictim), 0, MAX_CLIENTS);
else
m_Victim = clamp<int>(str_toint(pVictim), 0, MAX_CLIENTS);
}