From 083f7ba7ab0c923ff19962f222adb4b5b2f8e817 Mon Sep 17 00:00:00 2001 From: dobrykafe Date: Thu, 11 Apr 2024 18:26:56 +0200 Subject: [PATCH] prevent enabling `/team0mode` while practice mode is active --- src/game/server/ddracechat.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index f9d3aede7..5830d4567 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -1176,10 +1176,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); + } } }