Merge pull request #8199 from dobrykafe/pr-team0mode-fix

Prevent enabling `/team0mode` while practice mode is active
This commit is contained in:
Dennis Felsing 2024-04-11 16:45:22 +00:00 committed by GitHub
commit 1adae02291
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1185,10 +1185,17 @@ void CGameContext::ConTeam0Mode(IConsole::IResult *pResult, void *pUserData)
}
else
{
pController->Teams().SetTeamFlock(Team, true);
if(pController->Teams().IsPractice(Team))
{
pSelf->SendChatTarget(pResult->m_ClientId, "Can't enable team 0 mode with practice mode on.");
}
else
{
pController->Teams().SetTeamFlock(Team, true);
str_format(aBuf, sizeof(aBuf), "'%s' enabled team 0 mode. This will make your team behave like team 0.", pSelf->Server()->ClientName(pResult->m_ClientId));
pSelf->SendChatTeam(Team, aBuf);
str_format(aBuf, sizeof(aBuf), "'%s' enabled team 0 mode. This will make your team behave like team 0.", pSelf->Server()->ClientName(pResult->m_ClientId));
pSelf->SendChatTeam(Team, aBuf);
}
}
}