mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Check IDs in a more reasonable order
This commit is contained in:
parent
b89c4f767c
commit
9d5459d731
|
@ -1247,8 +1247,6 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
}
|
||||
|
||||
int KickID = str_toint(pMsg->m_Value);
|
||||
if (!Server()->ReverseTranslate(KickID, ClientID))
|
||||
return;
|
||||
|
||||
if(KickID < 0 || KickID >= MAX_CLIENTS || !m_apPlayers[KickID])
|
||||
{
|
||||
|
@ -1260,6 +1258,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
SendChatTarget(ClientID, "You can't kick yourself");
|
||||
return;
|
||||
}
|
||||
if (!Server()->ReverseTranslate(KickID, ClientID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
//if(Server()->IsAuthed(KickID))
|
||||
if(m_apPlayers[KickID]->m_Authed > 0 && m_apPlayers[KickID]->m_Authed >= pPlayer->m_Authed)
|
||||
{
|
||||
|
@ -1302,8 +1304,6 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
}
|
||||
|
||||
int SpectateID = str_toint(pMsg->m_Value);
|
||||
if (!Server()->ReverseTranslate(SpectateID, ClientID))
|
||||
return;
|
||||
|
||||
if(SpectateID < 0 || SpectateID >= MAX_CLIENTS || !m_apPlayers[SpectateID] || m_apPlayers[SpectateID]->GetTeam() == TEAM_SPECTATORS)
|
||||
{
|
||||
|
@ -1315,6 +1315,10 @@ void CGameContext::OnMessage(int MsgID, CUnpacker *pUnpacker, int ClientID)
|
|||
SendChatTarget(ClientID, "You can't move yourself");
|
||||
return;
|
||||
}
|
||||
if (!Server()->ReverseTranslate(SpectateID, ClientID))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(!GetPlayerChar(ClientID) || !GetPlayerChar(SpectateID) || GetDDRaceTeam(ClientID) != GetDDRaceTeam(SpectateID))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue