GameController: Introduce GetMaskForPlayerWorldEvent()

This commit is contained in:
Alexander Akulich 2021-01-13 02:51:28 +03:00
parent d536743dda
commit d2744d595a
4 changed files with 18 additions and 0 deletions

View file

@ -657,6 +657,12 @@ int IGameController::ClampTeam(int Team)
return 0;
}
int64 IGameController::GetMaskForPlayerWorldEvent(int Asker, int ExceptID)
{
// Send all world events to everyone by default
return CmaskAllExceptOne(ExceptID);
}
void IGameController::DoTeamChange(CPlayer *pPlayer, int Team, bool DoChatMsg)
{
Team = ClampTeam(Team);

View file

@ -151,6 +151,8 @@ public:
virtual bool CanJoinTeam(int Team, int NotThisID);
int ClampTeam(int Team);
virtual int64 GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1);
// DDRace
float m_CurrentRecord;

View file

@ -164,6 +164,14 @@ void CGameControllerDDRace::DoTeamChange(class CPlayer *pPlayer, int Team, bool
IGameController::DoTeamChange(pPlayer, Team, DoChatMsg);
}
int64 CGameControllerDDRace::GetMaskForPlayerWorldEvent(int Asker, int ExceptID)
{
if(Asker == -1)
return CmaskAllExceptOne(ExceptID);
return m_Teams.TeamMask(GetPlayerTeam(Asker), ExceptID, Asker);
}
void CGameControllerDDRace::InitTeleporter()
{
if(!GameServer()->Collision()->Layers()->TeleLayer())

View file

@ -24,6 +24,8 @@ public:
void DoTeamChange(class CPlayer *pPlayer, int Team, bool DoChatMsg = true) override;
int64 GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1) override;
void InitTeleporter();
int GetPlayerTeam(int ClientID) const;