mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Make spectators see the same thing as the player they spectate
This commit is contained in:
parent
02372ac0b0
commit
ebf64758b1
|
@ -890,15 +890,14 @@ void CCharacter::Snap(int SnappingClient)
|
|||
return;
|
||||
|
||||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
if(SnapChar && !SnapChar->m_Super && !SnapChar->IsPaused() &&
|
||||
GameServer()->m_apPlayers[SnappingClient]->GetTeam() != -1 &&
|
||||
!CanCollide(SnappingClient) &&
|
||||
(!GameServer()->m_apPlayers[SnappingClient]->m_IsUsingDDRaceClient ||
|
||||
(GameServer()->m_apPlayers[SnappingClient]->m_IsUsingDDRaceClient &&
|
||||
!GameServer()->m_apPlayers[SnappingClient]->m_ShowOthers
|
||||
)
|
||||
)
|
||||
)
|
||||
CPlayer* SnapPlayer = GameServer()->m_apPlayers[SnappingClient];
|
||||
|
||||
if((SnapPlayer->GetTeam() == TEAM_SPECTATORS || SnapPlayer->m_Paused) && SnapPlayer->m_SpectatorID != -1
|
||||
&& !CanCollide(SnapPlayer->m_SpectatorID) && !SnapPlayer->m_ShowOthers)
|
||||
return;
|
||||
|
||||
if( SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->m_Paused && SnapChar && !SnapChar->m_Super
|
||||
&& !CanCollide(SnappingClient) && !SnapPlayer->m_ShowOthers)
|
||||
return;
|
||||
|
||||
if (m_Paused)
|
||||
|
|
|
@ -87,6 +87,7 @@ void CPlasma::Snap(int SnappingClient)
|
|||
if (NetworkClipped(SnappingClient))
|
||||
return;
|
||||
CCharacter* SnapChar = GameServer()->GetPlayerChar(SnappingClient);
|
||||
CPlayer* SnapPlayer = GameServer()->m_apPlayers[SnappingClient];
|
||||
int Tick = (Server()->Tick() % Server()->TickSpeed()) % 11;
|
||||
|
||||
if (SnapChar && SnapChar->IsAlive()
|
||||
|
@ -94,11 +95,18 @@ void CPlasma::Snap(int SnappingClient)
|
|||
&& !GameServer()->Collision()->m_pSwitchers[m_Number].m_Status[SnapChar->Team()])
|
||||
&& (!Tick))
|
||||
return;
|
||||
if (SnapChar && (SnapChar->Team() != m_ResponsibleTeam)
|
||||
&& (!SnapChar->GetPlayer()->m_IsUsingDDRaceClient
|
||||
|| (GameServer()->m_apPlayers[SnappingClient]->m_IsUsingDDRaceClient
|
||||
&& !GameServer()->m_apPlayers[SnappingClient]->m_ShowOthers)))
|
||||
|
||||
if((SnapPlayer->GetTeam() == TEAM_SPECTATORS || SnapPlayer->m_Paused) && SnapPlayer->m_SpectatorID != -1
|
||||
&& GameServer()->GetPlayerChar(SnapPlayer->m_SpectatorID)
|
||||
&& GameServer()->GetPlayerChar(SnapPlayer->m_SpectatorID)->Team() != m_ResponsibleTeam
|
||||
&& !SnapPlayer->m_ShowOthers)
|
||||
return;
|
||||
|
||||
if( SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->m_Paused && SnapChar
|
||||
&& SnapChar && SnapChar->Team() != m_ResponsibleTeam
|
||||
&& !SnapPlayer->m_ShowOthers)
|
||||
return;
|
||||
|
||||
CNetObj_Laser *pObj = static_cast<CNetObj_Laser *>(Server()->SnapNewItem(
|
||||
NETOBJTYPE_LASER, m_ID, sizeof(CNetObj_Laser)));
|
||||
pObj->m_X = (int) m_Pos.x;
|
||||
|
|
Loading…
Reference in a new issue