source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

Hide voice labels for cloaked enemy spies

Open ficool2 opened this issue 10 months ago • 2 comments

When using voice chat, a sprite will appear above the player's head. Unfortunately, this does even when cloaked as a spy which obviously reveals your position. This PR changes that so the sprite does not appear for enemy spies that are cloaked.

In addition, the voice label now shows the disguised team's voice label for enemy spies.

ficool2 avatar Feb 25 '25 22:02 ficool2

Another problem is the color of the speech bubble - it reveals the Spy's real team. The color difference is big enough to notice. Since C_TFPlayer::GetHeadLabelMaterial appears to run only on the client, I think something like this would work:

if (player is spy && he's enemy to localPlayer && he's disguised as enemy)
  render his speech bubble in localPlayer's team's color
else
  proceed as normal

Lizard-Of-Oz avatar Feb 26 '25 07:02 Lizard-Of-Oz

If it doesn't already exist, it may be worth including a replicated server cvar for this to preserve the legacy behavior (and for that to also affect the "Player is typing" bubble if that gets merged). If the cvar does exist, additional values for changing the behavior back to legacy would be nice.

FlaminSarge avatar Feb 27 '25 02:02 FlaminSarge

If it doesn't already exist, it may be worth including a replicated server cvar for this to preserve the legacy behavior (and for that to also affect the "Player is typing" bubble if that gets merged). If the cvar does exist, additional values for changing the behavior back to legacy would be nice.

Wrote a basic implementation here if ficool2 wishes to implement this

https://github.com/BitlDevelopmentStudios/source-sdk-2013-bds-base/commit/fa152bef573bb6291ae0316397c0d3d61bf93268

doing this is unnecessary for the "Player is typing" bubble as it has its own cvar

Bitl avatar Mar 06 '25 04:03 Bitl