Rate-limit /lock (fixes #1122)

This commit is contained in:
def 2018-05-11 22:05:32 +02:00
parent a7b778977a
commit 59675fe63c

View file

@ -771,8 +771,18 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData)
if (pResult->NumArguments() > 0)
Lock = !pResult->GetInteger(0);
if(Team > TEAM_FLOCK && Team < TEAM_SUPER)
if(Team <= TEAM_FLOCK || Team >= TEAM_SUPER)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"print",
"This team can't be locked");
return;
}
if(pSelf->ProcessSpamProtection(pResult->m_ClientID))
return;
char aBuf[512];
if(Lock)
{
@ -801,12 +811,6 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData)
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
pSelf->SendChatTarget(i, aBuf);
}
}
else
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"print",
"This team can't be locked");
}
void CGameContext::ConInviteTeam(IConsole::IResult *pResult, void *pUserData)