mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed a bug with "me" as victim, fixed kick function due to new victim system
This commit is contained in:
parent
40eade2021
commit
c36eb3d359
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue