You srsly REALLY can't join teams that fast!

This commit is contained in:
GreYFoX 2011-12-25 13:20:10 +02:00
parent 81b34086e2
commit 28cd7afa24

View file

@ -384,19 +384,16 @@ void CGameContext::ConJoinTeam(IConsole::IResult *pResult, void *pUserData)
}
else
{
if(((CGameControllerDDRace*)pSelf->m_pController)->m_Teams.SetCharacterTeam(pPlayer->GetCID(), pResult->GetInteger(0)))
if(pPlayer->m_Last_Team + pSelf->Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay > pSelf->Server()->Tick())
{
if(pPlayer->m_Last_Team + pSelf->Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay <= pSelf->Server()->Tick())
{
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "%s joined team %d", pSelf->Server()->ClientName(pPlayer->GetCID()), pResult->GetInteger(0));
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
pPlayer->m_Last_Team = pSelf->Server()->Tick();
}
else
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join", "You can\'t join teams that fast!");
}
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "join", "You can\'t join teams that fast!");
}
else if(((CGameControllerDDRace*)pSelf->m_pController)->m_Teams.SetCharacterTeam(pPlayer->GetCID(), pResult->GetInteger(0)))
{
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "%s joined team %d", pSelf->Server()->ClientName(pPlayer->GetCID()), pResult->GetInteger(0));
pSelf->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
pPlayer->m_Last_Team = pSelf->Server()->Tick();
}
else
{