CPlayer: Port to GetMaskForPlayerWorldEvent

The CPlayer class does not depend on CGameTeams anymore.
This commit is contained in:
Alexander Akulich 2021-01-13 03:02:28 +03:00
parent d2744d595a
commit c28bd693d3

View file

@ -7,7 +7,6 @@
#include "gamecontext.h"
#include <engine/server.h>
#include <game/gamecore.h>
#include <game/server/teams.h>
#include <game/version.h>
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: