mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
GameController: Introduce GetMaskForPlayerWorldEvent()
This commit is contained in:
parent
d536743dda
commit
d2744d595a
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue