No longer trigger an assert when binding a key to an action that does not exist (closes #2485)

This commit is contained in:
Alexander Bock
2023-02-06 23:17:16 +01:00
parent f7ff2e33da
commit be122a5a73
2 changed files with 13 additions and 5 deletions

View File

@@ -55,11 +55,11 @@ void KeybindingManager::keyboardCallback(Key key, KeyModifier modifier, KeyActio
auto ret = _keyLua.equal_range({ key, modifier });
for (auto it = ret.first; it != ret.second; ++it) {
ghoul_assert(!it->second.empty(), "Action must not be empty");
ghoul_assert(
global::actionManager->hasAction(it->second),
"Action must be registered"
);
global::actionManager->triggerAction(it->second, ghoul::Dictionary());
if (!global::actionManager->hasAction(it->second)) {
// Silently ignoring the unknown action as the user might have intended to
// bind a key to multiple actions, only one of which could be defined
global::actionManager->triggerAction(it->second, ghoul::Dictionary());
}
}
}
}