mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Print message when team starts playing to team members
This commit is contained in:
parent
50a397e32c
commit
f3d4fcf012
|
@ -82,6 +82,17 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
|||
if (m_TeamState[m_Core.Team(ClientID)] < TEAMSTATE_STARTED && !Waiting)
|
||||
{
|
||||
ChangeTeamState(m_Core.Team(ClientID), TEAMSTATE_STARTED);
|
||||
|
||||
char aBuf[512];
|
||||
str_format(
|
||||
aBuf,
|
||||
sizeof(aBuf),
|
||||
"Team %d started with these %d players: ",
|
||||
m_Core.Team(ClientID),
|
||||
Count(m_Core.Team(ClientID)));
|
||||
|
||||
bool First = true;
|
||||
|
||||
for (int i = 0; i < MAX_CLIENTS; ++i)
|
||||
{
|
||||
if (m_Core.Team(ClientID) == m_Core.Team(i))
|
||||
|
@ -92,6 +103,23 @@ void CGameTeams::OnCharacterStart(int ClientID)
|
|||
{
|
||||
SetDDRaceState(pPlayer, DDRACE_STARTED);
|
||||
SetStartTime(pPlayer, Tick);
|
||||
|
||||
if (First)
|
||||
First = false;
|
||||
else
|
||||
str_append(aBuf, ", ", sizeof(aBuf));
|
||||
|
||||
str_append(aBuf, GameServer()->Server()->ClientName(i), sizeof(aBuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_CLIENTS; ++i)
|
||||
{
|
||||
CPlayer* pPlayer = GetPlayer(i);
|
||||
if (m_Core.Team(ClientID) == m_Core.Team(i) && pPlayer && (pPlayer->IsPlaying() || TeamLocked(m_Core.Team(ClientID))))
|
||||
{
|
||||
GameServer()->SendChatTarget(i, aBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue