Merge pull request #7474 from ChillerDragon/pr_mod_crash

Fix crash in mod controller
This commit is contained in:
Dennis Felsing 2023-11-18 19:59:22 +00:00 committed by GitHub
commit ccd767aea4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 13 deletions

View file

@ -731,8 +731,10 @@ int IGameController::ClampTeam(int Team)
CClientMask IGameController::GetMaskForPlayerWorldEvent(int Asker, int ExceptID)
{
// Send all world events to everyone by default
return CClientMask().set().reset(ExceptID);
if(Asker == -1)
return CClientMask().set().reset(ExceptID);
return Teams().TeamMask(GameServer()->GetDDRaceTeam(Asker), ExceptID, Asker);
}
void IGameController::InitTeleporter()

View file

@ -146,7 +146,7 @@ public:
virtual bool CanJoinTeam(int Team, int NotThisID);
int ClampTeam(int Team);
virtual CClientMask GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1);
CClientMask GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1);
virtual void InitTeleporter();
// DDRace

View file

@ -200,11 +200,3 @@ void CGameControllerDDRace::DoTeamChange(class CPlayer *pPlayer, int Team, bool
IGameController::DoTeamChange(pPlayer, Team, DoChatMsg);
}
CClientMask CGameControllerDDRace::GetMaskForPlayerWorldEvent(int Asker, int ExceptID)
{
if(Asker == -1)
return CClientMask().set().reset(ExceptID);
return Teams().TeamMask(GameServer()->GetDDRaceTeam(Asker), ExceptID, Asker);
}

View file

@ -24,8 +24,6 @@ public:
void DoTeamChange(class CPlayer *pPlayer, int Team, bool DoChatMsg = true) override;
CClientMask GetMaskForPlayerWorldEvent(int Asker, int ExceptID = -1) override;
std::shared_ptr<CScoreLoadBestTimeResult> m_pLoadBestTimeResult;
};
#endif // GAME_SERVER_GAMEMODES_DDRACE_H