From f3257e3949c653b55661752c13511e29ed7f3edf Mon Sep 17 00:00:00 2001 From: def Date: Thu, 26 Jun 2014 01:33:10 +0200 Subject: [PATCH] Show who locked and unlocked a team --- src/game/server/ddracechat.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/game/server/ddracechat.cpp b/src/game/server/ddracechat.cpp index 754188dd6..6fdbd121f 100644 --- a/src/game/server/ddracechat.cpp +++ b/src/game/server/ddracechat.cpp @@ -650,21 +650,26 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData) if(Team > TEAM_FLOCK && Team < TEAM_SUPER) { + char aBuf[512]; if(Lock) { ((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, false); + str_format(aBuf, sizeof(aBuf), "Your team is now unlocked (by %s).", pSelf->Server()->ClientName(pResult->m_ClientID)); + for (int i = 0; i < MAX_CLIENTS; i++) if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team) - pSelf->SendChatTarget(i, "Your team is now unlocked."); + pSelf->SendChatTarget(i, aBuf); } else { ((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, true); + str_format(aBuf, sizeof(aBuf), "Your team is now locked (by %s). After the race started killing will kill everyone in your team.", pSelf->Server()->ClientName(pResult->m_ClientID)); + for (int i = 0; i < MAX_CLIENTS; i++) if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team) - pSelf->SendChatTarget(i, "Your team is now locked. After the race started killing will kill everyone in your team."); + pSelf->SendChatTarget(i, aBuf); } } else