mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-22 06:43:54 -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()
|
void AbstractCounter::setShortcutsActive()
|
||||||
{
|
{
|
||||||
|
if (!menu) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!player->getPlayerInfo()->getLocal()) {
|
if (!player->getPlayerInfo()->getLocal()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
ShortcutsSettings &shortcuts = SettingsCache::instance().shortcuts();
|
||||||
if (name == "life") {
|
if (name == "life") {
|
||||||
shortcutActive = true;
|
shortcutActive = true;
|
||||||
|
|
@ -104,6 +108,10 @@ void AbstractCounter::setShortcutsActive()
|
||||||
|
|
||||||
void AbstractCounter::setShortcutsInactive()
|
void AbstractCounter::setShortcutsInactive()
|
||||||
{
|
{
|
||||||
|
if (!menu) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
shortcutActive = false;
|
shortcutActive = false;
|
||||||
if (name == "life" || useNameForShortcut) {
|
if (name == "life" || useNameForShortcut) {
|
||||||
aSet->setShortcut(QKeySequence());
|
aSet->setShortcut(QKeySequence());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue