mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed unsafe /team
Signed-off-by: GreYFoXGTi <GreYFoXGTi@GMaiL.CoM>
This commit is contained in:
parent
be122406ef
commit
0763a62601
|
@ -918,7 +918,7 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
if(sscanf(pMsg->m_pMessage, "/team %d", &Num) == 1)
|
||||
{
|
||||
if(pPlayer->GetCharacter() == 0) {
|
||||
SendChatTarget(ClientId, "You can't change teams while you are dead.");
|
||||
SendChatTarget(ClientId, "You can't change teams while you are dead/a spectator.");
|
||||
} else {
|
||||
if(((CGameControllerDDRace*)m_pController)->m_Teams.SetCharacterTeam(pPlayer->GetCID(), Num)) {
|
||||
char aBuf[512];
|
||||
|
@ -932,8 +932,12 @@ void CGameContext::OnMessage(int MsgId, CUnpacker *pUnpacker, int ClientId)
|
|||
else
|
||||
{
|
||||
char aBuf[512];
|
||||
if(pPlayer->GetCharacter() == 0) {
|
||||
SendChatTarget(ClientId, "You can't check your team while you are dead/a spectator.");
|
||||
} else {
|
||||
str_format(aBuf, sizeof(aBuf), "You are in team %d", pPlayer->GetCharacter()->Team());
|
||||
SendChatTarget(ClientId, aBuf);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue