mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix crash when changing shortcut in game (#6318)
This commit is contained in:
parent
ae123587d7
commit
84e0732fb1
1 changed files with 8 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue