From c28bd693d3b8782a3b8ef824aae0e6c70ecb5bb7 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Wed, 13 Jan 2021 03:02:28 +0300 Subject: [PATCH] CPlayer: Port to GetMaskForPlayerWorldEvent The CPlayer class does not depend on CGameTeams anymore. --- src/game/server/player.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/game/server/player.cpp b/src/game/server/player.cpp index 33206523f..1554ec453 100644 --- a/src/game/server/player.cpp +++ b/src/game/server/player.cpp @@ -7,7 +7,6 @@ #include "gamecontext.h" #include #include -#include #include MACRO_ALLOC_POOL_ID_IMPL(CPlayer, MAX_CLIENTS) @@ -691,7 +690,7 @@ void CPlayer::TryRespawn() m_Spawning = false; m_pCharacter = new(m_ClientID) CCharacter(&GameServer()->m_World); m_pCharacter->Spawn(this, SpawnPos); - GameServer()->CreatePlayerSpawn(SpawnPos, m_pCharacter->Teams()->TeamMask(m_pCharacter->Team(), -1, m_ClientID)); + GameServer()->CreatePlayerSpawn(SpawnPos, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID)); if(g_Config.m_SvTeam == 3) m_pCharacter->SetSolo(true); @@ -816,8 +815,8 @@ void CPlayer::ProcessPause() if(m_Paused == PAUSE_SPEC && !m_pCharacter->IsPaused() && m_pCharacter->IsGrounded() && m_pCharacter->m_Pos == m_pCharacter->m_PrevPos) { m_pCharacter->Pause(true); - GameServer()->CreateDeath(m_pCharacter->m_Pos, m_ClientID, m_pCharacter->Teams()->TeamMask(m_pCharacter->Team(), -1, m_ClientID)); - GameServer()->CreateSound(m_pCharacter->m_Pos, SOUND_PLAYER_DIE, m_pCharacter->Teams()->TeamMask(m_pCharacter->Team(), -1, m_ClientID)); + GameServer()->CreateDeath(m_pCharacter->m_Pos, m_ClientID, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID)); + GameServer()->CreateSound(m_pCharacter->m_Pos, SOUND_PLAYER_DIE, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID)); } } @@ -845,7 +844,7 @@ int CPlayer::Pause(int State, bool Force) return m_Paused; // Do not update state. Do not collect $200 } m_pCharacter->Pause(false); - GameServer()->CreatePlayerSpawn(m_pCharacter->m_Pos, m_pCharacter->Teams()->TeamMask(m_pCharacter->Team(), -1, m_ClientID)); + GameServer()->CreatePlayerSpawn(m_pCharacter->m_Pos, GameServer()->m_pController->GetMaskForPlayerWorldEvent(m_ClientID)); } // fall-thru case PAUSE_SPEC: