mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
You srsly REALLY can't join teams that fast!
This commit is contained in:
parent
81b34086e2
commit
28cd7afa24
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue