mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-12 15:49:28 -08:00
Fix crash when changing shortcut in game (#6318)
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user