ShowOthers for regular DDRace client

This commit is contained in:
def 2014-01-30 17:28:30 +01:00
parent b21dc83b1a
commit 8d877973ee
2 changed files with 18 additions and 4 deletions

View file

@ -1042,7 +1042,7 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
if(Unpacker.Error() == 0 && !str_comp(pCmd, "crashmeplx"))
{
CGameContext *GameServer = (CGameContext *) m_pGameServer;
if (GameServer->m_apPlayers[ClientID] && GameServer->m_apPlayers[ClientID]->m_ClientVersion < DDNET_OLD)
if (GameServer->m_apPlayers[ClientID] && GameServer->m_apPlayers[ClientID]->m_ClientVersion < VERSION_DDNET_OLD)
GameServer->m_apPlayers[ClientID]->m_ClientVersion = VERSION_DDNET_OLD;
} else
if(Unpacker.Error() == 0 && m_aClients[ClientID].m_Authed)

View file

@ -314,13 +314,27 @@ void CGameTeams::SendTeamsState(int ClientID)
if (g_Config.m_SvTeam == 3)
return;
if (m_pGameContext->m_apPlayers[ClientID] && m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion <= VERSION_DDRACE)
if (!m_pGameContext->m_apPlayers[ClientID] || m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion < VERSION_DDRACE)
return;
CMsgPacker Msg(NETMSGTYPE_SV_TEAMSSTATE);
for(unsigned i = 0; i < MAX_CLIENTS; i++)
Msg.AddInt(m_Core.Team(i));
if (m_pGameContext->m_apPlayers[ClientID]->m_ClientVersion == VERSION_DDRACE)
{
for(unsigned i = 0; i < VANILLA_MAX_CLIENTS; i++)
{
int target = 0;
Server()->ReverseTranslate(target, i);
Msg.AddInt(m_Core.Team(target));
}
}
else
{
for(unsigned i = 0; i < MAX_CLIENTS; i++)
{
Msg.AddInt(m_Core.Team(i));
}
}
Server()->SendMsg(&Msg, MSGFLAG_VITAL, ClientID);
}