From fe7f2740231abe127bf3e70b3428f404d974ed47 Mon Sep 17 00:00:00 2001 From: def Date: Tue, 21 Jan 2014 18:21:01 +0100 Subject: [PATCH] Fix: Proper super on DDRace 16 player servers --- src/game/client/gameclient.cpp | 2 ++ src/game/gamecore.cpp | 2 +- src/game/server/teams.cpp | 11 +++++++---- src/game/teamscore.cpp | 4 +++- src/game/teamscore.h | 3 ++- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 327c6280e..4da796486 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -629,6 +629,8 @@ void CGameClient::OnMessage(int MsgId, CUnpacker *pUnpacker) m_Teams.Team(13, pMsg->m_Tee13); m_Teams.Team(14, pMsg->m_Tee14); m_Teams.Team(15, pMsg->m_Tee15); + + m_Teams.m_IsDDRace16 = true; } else if(MsgId == NETMSGTYPE_SV_PLAYERTIME) { diff --git a/src/game/gamecore.cpp b/src/game/gamecore.cpp index bb646b644..8155cae5f 100644 --- a/src/game/gamecore.cpp +++ b/src/game/gamecore.cpp @@ -576,7 +576,7 @@ void CCharacterCore::Quantize() bool CCharacterCore::IsRightTeam(int MapIndex) { if(Collision()->m_pSwitchers) - if(m_pTeams->Team(m_Id) != TEAM_SUPER) + if(m_pTeams->Team(m_Id) != m_pTeams->m_IsDDRace16 ? VANILLA_TEAM_SUPER : TEAM_SUPER) return Collision()->m_pSwitchers[Collision()->GetDTileNumber(MapIndex)].m_Status[m_pTeams->Team(m_Id)]; return false; } diff --git a/src/game/server/teams.cpp b/src/game/server/teams.cpp index 1c319e216..6fcc9bf6b 100644 --- a/src/game/server/teams.cpp +++ b/src/game/server/teams.cpp @@ -189,9 +189,13 @@ void CGameTeams::SetForceCharacterTeam(int ClientID, int Team) //for (int LoopClientID = 0; LoopClientID < MAX_CLIENTS; ++LoopClientID) //{ - // if (GetPlayer(LoopClientID) - // && GetPlayer(LoopClientID)->m_IsUsingDDRaceClient) - // SendTeamsState(LoopClientID); + // if (GetPlayer(LoopClientID)) + // { + // if (((CServer *) Server())->m_aClients[LoopClientID].m_CustClt) + // SendTeamsState64(LoopClientID); + // else if (GetPlayer(LoopClientID)->m_IsUsingDDRaceClient) + // SendTeamsState(LoopClientID); + // } //} } @@ -325,7 +329,6 @@ void CGameTeams::SendTeamsState(int ClientID) Msg.m_Tee15 = m_Core.Team(15); Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID); - } int CGameTeams::GetDDRaceState(CPlayer* Player) diff --git a/src/game/teamscore.cpp b/src/game/teamscore.cpp index 8f8c6a48e..ca453bda7 100644 --- a/src/game/teamscore.cpp +++ b/src/game/teamscore.cpp @@ -23,7 +23,7 @@ void CTeamsCore::Team(int ClientID, int Team) bool CTeamsCore::CanCollide(int ClientID1, int ClientID2) { - if (m_Team[ClientID1] == TEAM_SUPER || m_Team[ClientID2] == TEAM_SUPER + if (m_Team[ClientID1] == m_IsDDRace16 ? VANILLA_TEAM_SUPER : TEAM_SUPER || m_Team[ClientID2] == m_IsDDRace16 ? VANILLA_TEAM_SUPER : TEAM_SUPER || ClientID1 == ClientID2) return true; if (m_IsSolo[ClientID1] || m_IsSolo[ClientID2]) @@ -33,6 +33,8 @@ bool CTeamsCore::CanCollide(int ClientID1, int ClientID2) void CTeamsCore::Reset() { + m_IsDDRace16 = false; + for (int i = 0; i < MAX_CLIENTS; ++i) { m_Team[i] = TEAM_FLOCK; diff --git a/src/game/teamscore.h b/src/game/teamscore.h index d4d872713..bd2587df0 100644 --- a/src/game/teamscore.h +++ b/src/game/teamscore.h @@ -6,7 +6,7 @@ enum { - TEAM_FLOCK = 0, TEAM_SUPER = MAX_CLIENTS + TEAM_FLOCK = 0, TEAM_SUPER = MAX_CLIENTS, VANILLA_TEAM_SUPER = VANILLA_MAX_CLIENTS }; class CTeamsCore @@ -15,6 +15,7 @@ class CTeamsCore int m_Team[MAX_CLIENTS]; bool m_IsSolo[MAX_CLIENTS]; public: + bool m_IsDDRace16; CTeamsCore(void);