Introduce additional checks for playerMenu shortcut activation for judges (#6275)

* Introduce additional checks for playerMenu shortcut activation when they are accessed by a judge, only activating them if the player is a local player.

Took 2 hours 7 minutes


Took 17 minutes

* Undo example change.

Took 5 minutes

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL
2025-11-08 22:22:02 +01:00
committed by GitHub
parent a8a3fca8c9
commit 55aaca0e0d

View File

@@ -139,7 +139,14 @@ void PlayerMenu::retranslateUi()
void PlayerMenu::refreshShortcuts()
{
if (shortcutsActive) {
setShortcutsActive();
// Judges get access to every player's menus but only want shortcuts to be set for their own.
if (player->getPlayerInfo()->getLocalOrJudge() && !player->getPlayerInfo()->getLocal()) {
setShortcutsInactive();
} else {
setShortcutsActive();
}
} else {
setShortcutsInactive();
}
}