Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/game/client/neo/c_neo_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,12 @@ void C_NEO_Player::PreThink( void )
// Disable client side glow effects of all players
glow_outline_effect_enable.SetValue(false);
#endif // GLOWS_ENABLE

// Reset any player explosion/shock effects
// NEO NOTE (Rain): The game already does this at CBasePlayer::Spawn, but that one's server-side,
// so it could arrive too late.
CLocalPlayerFilter filter;
enginesound->SetPlayerDSP(filter, 0, true);
}
}
else
Expand Down
29 changes: 29 additions & 0 deletions src/game/server/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1478,8 +1478,31 @@ void CBasePlayer::OnDamagedByExplosion( const CTakeDamageInfo &info )
random->RandomInt( 35, 37 ) :
random->RandomInt( 32, 34 );

#ifdef NEO
CRecipientFilter recipients;
recipients.MakeReliable();
recipients.AddRecipient(this);
const int thisClientIdx = ENTINDEX(this);
for (int clientIdx = 1; clientIdx <= gpGlobals->maxClients; ++clientIdx)
{
// Also play the ear-ringing for POV spectators.
if (clientIdx != thisClientIdx)
{
const auto otherPlayer = UTIL_PlayerByIndex(clientIdx);
if (!otherPlayer || !otherPlayer->IsObserver() ||
otherPlayer->GetObserverMode() != OBS_MODE_IN_EYE ||
otherPlayer->GetObserverTarget() != this)
{
continue;
}
recipients.AddRecipient(otherPlayer);
}
}
enginesound->SetPlayerDSP(recipients, effect, false);
#else
CSingleUserRecipientFilter user( this );
enginesound->SetPlayerDSP( user, effect, false );
#endif
}

//=========================================================
Expand Down Expand Up @@ -5304,6 +5327,12 @@ void CBasePlayer::Spawn( void )
Q_strncpy( m_szLastPlaceName.GetForModify(), "", MAX_PLACE_NAME_LENGTH );

CSingleUserRecipientFilter user( this );
#ifdef NEO
// So that the explosion ear-ringing SFX is reliably cleared.
// We already do this for the local C_NEO_Player (for faster response to remote clients),
// but this is made reliable for POV spectators' benefit.
user.MakeReliable();
#endif
enginesound->SetPlayerDSP( user, 0, false );

CreateViewModel();
Expand Down