Skip to content

Commit

Permalink
Fix medengymenu sounds for spectators
Browse files Browse the repository at this point in the history
After the commit 65a1d27 , players were still hearing the menu select sound upon pressing/spamming the `medengymenu` key (Z) if they were spectating, this fixes that.

Fixed a mistake in the `GetCustomClientColor()` function not working for unassigned team.
  • Loading branch information
YoYo178 committed May 25, 2024
1 parent fc39603 commit 257508e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mp/src/game/client/ff/hud/ff_hud_chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Color GetCustomClientColor(int iPlayerIndex, int iTeamIndex/* = -1*/)
if (!gr)
return GetDefaultChatColor();

if (iTeamIndex > 0) // prefer team index over player index
if (iTeamIndex >= 0) // prefer team index over player index
iTeam = iTeamIndex;
else if(iPlayerIndex > 0)
iTeam = gr->GetTeam(iPlayerIndex);
Expand Down
2 changes: 1 addition & 1 deletion mp/src/game/client/ff/hud/ff_hud_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ void CHudContextMenu::Display(bool state)
return;

// no.
if ( !pPlayer->IsAlive() && pPlayer->m_iHealth <= 0 )
if ( ( !pPlayer->IsAlive() && pPlayer->m_iHealth <= 0 ) || pPlayer->GetTeamNumber() == TEAM_SPECTATOR )
return;

// There is a menu and it's cancelling
Expand Down

0 comments on commit 257508e

Please sign in to comment.