mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 06:58:20 +00:00
Check finish of team after player joins spectators
Reported by Jupeyy
This commit is contained in:
parent
b3bbba8f48
commit
9d66c2530b
|
@ -631,7 +631,13 @@ void CPlayer::SetTeam(int Team, bool DoChatMsg)
|
|||
{
|
||||
CGameControllerDDRace *Controller = (CGameControllerDDRace *)GameServer()->m_pController;
|
||||
if(g_Config.m_SvTeam != 3)
|
||||
{
|
||||
// Joining spectators should not kill a locked team, but should still
|
||||
// check if the team finished by you leaving it.
|
||||
int DDRTeam = m_pCharacter->Team();
|
||||
Controller->m_Teams.SetForceCharacterTeam(m_ClientID, TEAM_FLOCK);
|
||||
Controller->m_Teams.CheckTeamFinished(DDRTeam);
|
||||
}
|
||||
}
|
||||
|
||||
KillCharacter();
|
||||
|
|
|
@ -19,7 +19,6 @@ class CGameTeams
|
|||
|
||||
class CGameContext *m_pGameContext;
|
||||
|
||||
void CheckTeamFinished(int ClientID);
|
||||
bool TeamFinished(int Team);
|
||||
void OnTeamFinish(CPlayer **Players, unsigned int Size, float Time, const char *pTimestamp);
|
||||
void OnFinish(CPlayer *Player, float Time, const char *pTimestamp);
|
||||
|
@ -62,6 +61,7 @@ public:
|
|||
void OnCharacterDeath(int ClientID, int Weapon);
|
||||
|
||||
bool SetCharacterTeam(int ClientID, int Team);
|
||||
void CheckTeamFinished(int ClientID);
|
||||
|
||||
void ChangeTeamState(int Team, int State);
|
||||
void onChangeTeamState(int Team, int State, int OldState);
|
||||
|
|
Loading…
Reference in a new issue