From 257508ea827c157e2206c2d75e0fc5ec1999e242 Mon Sep 17 00:00:00 2001 From: -_YoYo178_- <95132723+YoYo178@users.noreply.github.com> Date: Sat, 25 May 2024 15:19:48 +0530 Subject: [PATCH] Fix medengymenu sounds for spectators After the commit 65a1d2774c1f30bd5037658a3b352e57f8b9048c , 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. --- mp/src/game/client/ff/hud/ff_hud_chat.cpp | 2 +- mp/src/game/client/ff/hud/ff_hud_menu.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mp/src/game/client/ff/hud/ff_hud_chat.cpp b/mp/src/game/client/ff/hud/ff_hud_chat.cpp index 8f1ee46d..02164cd0 100644 --- a/mp/src/game/client/ff/hud/ff_hud_chat.cpp +++ b/mp/src/game/client/ff/hud/ff_hud_chat.cpp @@ -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); diff --git a/mp/src/game/client/ff/hud/ff_hud_menu.cpp b/mp/src/game/client/ff/hud/ff_hud_menu.cpp index 102c6ff4..d6b8c67f 100644 --- a/mp/src/game/client/ff/hud/ff_hud_menu.cpp +++ b/mp/src/game/client/ff/hud/ff_hud_menu.cpp @@ -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