Fix crash when changing shortcut in game (#6318)

This commit is contained in:
RickyRister 2025-11-14 06:29:05 -08:00 committed by GitHub
parent ae123587d7
commit 84e0732fb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,9 +85,13 @@ void AbstractCounter::retranslateUi()
void AbstractCounter::setShortcutsActive()
{
if (!menu) {
return;
}
if (!player->getPlayerInfo()->getLocal()) {
return;
}
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
if (name == "life") {
shortcutActive = true;
@ -104,6 +108,10 @@ void AbstractCounter::setShortcutsActive()
void AbstractCounter::setShortcutsInactive()
{
if (!menu) {
return;
}
shortcutActive = false;
if (name == "life" || useNameForShortcut) {
aSet->setShortcut(QKeySequence());