Merge pull request #7648 from dobrykafe/pr-master-info

report the ddrace team to master instead of the normal team
This commit is contained in:
heinrich5991 2023-12-20 15:27:32 +00:00 committed by GitHub
commit ddd10f2308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View file

@ -4711,6 +4711,7 @@ void CGameContext::OnUpdatePlayerServerInfo(char *aBuf, int BufSize, int ID)
}
}
const int Team = m_pController->IsTeamPlay() ? m_apPlayers[ID]->GetTeam() : m_apPlayers[ID]->GetTeam() == TEAM_SPECTATORS ? -1 : GetDDRaceTeam(ID);
str_format(aBuf, BufSize,
",\"skin\":{"
"%s"
@ -4719,5 +4720,5 @@ void CGameContext::OnUpdatePlayerServerInfo(char *aBuf, int BufSize, int ID)
"\"team\":%d",
aJsonSkin,
JsonBool(m_apPlayers[ID]->IsAfk()),
m_apPlayers[ID]->GetTeam());
Team);
}

View file

@ -151,6 +151,7 @@ public:
CClientMask GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1);
virtual void InitTeleporter();
bool IsTeamPlay() { return m_GameFlags & GAMEFLAG_TEAMS; }
// DDRace
float m_CurrentRecord;

View file

@ -626,6 +626,11 @@ void CPlayer::SetTeam(int Team, bool DoChatMsg)
pPlayer->m_SpectatorID = SPEC_FREEVIEW;
}
}
if(!GameServer()->m_pController->IsTeamPlay())
{
Server()->ExpireServerInfo();
}
}
bool CPlayer::SetTimerType(int TimerType)