Skip to content

Commit

Permalink
icPickup: Allow the specs to see the pickups
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Sep 7, 2023
1 parent 659c130 commit ac97ec4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/game/server/infclass/entities/ic-pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,17 @@ void CIcPickup::Snap(int SnappingClient)
if(m_Type == EICPickupType::Invalid)
return;

const bool DoSnap = m_Owner < 0 || SnappingClient == SERVER_DEMO_CLIENT || SnappingClient == m_Owner;
const CPlayer *pSnappingPlayer = GameServer()->GetPlayer(SnappingClient);

bool DoSnap = m_Owner < 0 || SnappingClient == m_Owner || SnappingClient == SERVER_DEMO_CLIENT;
if(!DoSnap)
{
if(pSnappingPlayer && pSnappingPlayer->GetTeam() == TEAM_SPECTATORS)
{
DoSnap = pSnappingPlayer->m_SpectatorID < 0 || pSnappingPlayer->m_SpectatorID == m_Owner;
}
}

if(!DoSnap)
{
return;
Expand Down

0 comments on commit ac97ec4

Please sign in to comment.