mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 17:44:18 +00:00
More checks in timer
This commit is contained in:
parent
512597f729
commit
1a559c5d03
|
@ -1437,14 +1437,12 @@ void CGameContext::ConTimer(IConsole::IResult *pResult, void *pUserData, int cid
|
|||
CServer* serv = (CServer*)pSelf->Server();
|
||||
if(!g_Config.m_SvTimer) {
|
||||
|
||||
if(pResult->NumArguments() != 2) {
|
||||
serv->SendRconLine(cid, "Need 2 arguments for this command");
|
||||
return;
|
||||
}
|
||||
int cid1 = clamp(pResult->GetInteger(0), 0, (int)MAX_CLIENTS-1);
|
||||
int type = pResult->GetInteger(1);
|
||||
|
||||
CCharacter* chr = pSelf->m_apPlayers[cid1]->GetCharacter();
|
||||
CPlayer* pl = pSelf->m_apPlayers[cid1];
|
||||
if(pl != 0) {
|
||||
CCharacter* chr = pl->GetCharacter();
|
||||
if (!chr)
|
||||
return;
|
||||
if (type>1 || type<0)
|
||||
|
@ -1465,6 +1463,7 @@ void CGameContext::ConTimer(IConsole::IResult *pResult, void *pUserData, int cid
|
|||
}
|
||||
serv->SendRconLine(cid1, buf);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
serv->SendRconLine(cid, "Command timer does't allowed");
|
||||
|
|
Loading…
Reference in a new issue