mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix not alive team joining. Closes #45
This commit is contained in:
parent
7f6db8212e
commit
24b4c7ac71
|
@ -906,15 +906,16 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
|
||||
if(sscanf(pMsg->m_pMessage, "/team %d", &Num) == 1)
|
||||
{
|
||||
if(((CGameControllerDDRace*)m_pController)->m_Teams.SetCharacterTeam(pPlayer->GetCID(), Num))
|
||||
{
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "%s joined to Team %d", Server()->ClientName(pPlayer->GetCID()), Num);
|
||||
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendChatTarget(ClientId, "You cannot join to this team");
|
||||
if(pPlayer->GetCharacter() == 0) {
|
||||
SendChat(-1, CGameContext::CHAT_ALL, "Will be better if you will be alive");
|
||||
} else {
|
||||
if(((CGameControllerDDRace*)m_pController)->m_Teams.SetCharacterTeam(pPlayer->GetCID(), Num)) {
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "%s joined to Team %d", Server()->ClientName(pPlayer->GetCID()), Num);
|
||||
SendChat(-1, CGameContext::CHAT_ALL, aBuf);
|
||||
} else {
|
||||
SendChatTarget(ClientId, "You cannot join to this team");
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue