mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18: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();
|
CServer* serv = (CServer*)pSelf->Server();
|
||||||
if(!g_Config.m_SvTimer) {
|
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 cid1 = clamp(pResult->GetInteger(0), 0, (int)MAX_CLIENTS-1);
|
||||||
int type = pResult->GetInteger(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)
|
if (!chr)
|
||||||
return;
|
return;
|
||||||
if (type>1 || type<0)
|
if (type>1 || type<0)
|
||||||
|
@ -1465,6 +1463,7 @@ void CGameContext::ConTimer(IConsole::IResult *pResult, void *pUserData, int cid
|
||||||
}
|
}
|
||||||
serv->SendRconLine(cid1, buf);
|
serv->SendRconLine(cid1, buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
serv->SendRconLine(cid, "Command timer does't allowed");
|
serv->SendRconLine(cid, "Command timer does't allowed");
|
||||||
|
|
Loading…
Reference in a new issue