Reset Teams in Client

This commit is contained in:
btd 2010-09-24 11:12:26 +04:00
parent 24b4c7ac71
commit e6718e2ede
3 changed files with 10 additions and 3 deletions

View file

@ -418,6 +418,7 @@ void CGameClient::OnReset()
m_RaceMsgSent = false;
m_ShowOthers = -1;
m_FlagPos = vec2(-1, -1);
m_Teams.Reset();
}

View file

@ -1,9 +1,7 @@
#include "teamscore.h"
CTeamsCore::CTeamsCore() {
for(int i = 0; i < MAX_CLIENTS; ++i) {
m_Team[i] = TEAM_FLOCK;
}
Reset();
}
bool CTeamsCore::SameTeam(int Cid1, int Cid2) {
@ -21,4 +19,10 @@ void CTeamsCore::Team(int Cid, int Team) {
bool CTeamsCore::CanCollide(int Cid1, int Cid2) {
if(m_Team[Cid1] == TEAM_SUPER || m_Team[Cid2] == TEAM_SUPER) return true;
return m_Team[Cid1] == m_Team[Cid2];
}
void CTeamsCore::Reset() {
for(int i = 0; i < MAX_CLIENTS; ++i) {
m_Team[i] = TEAM_FLOCK;
}
}

View file

@ -21,6 +21,8 @@ public:
int Team(int Cid);
void Team(int Cid, int Team);
void Reset();
};
#endif