diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index b208bac6..1083db44 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -284,6 +284,7 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v auto valueCopy = value; const auto MOD = g_pKeybindManager->stringToModMask(valueCopy.substr(0, valueCopy.find_first_of(","))); + const auto MODSTR = valueCopy.substr(0, valueCopy.find_first_of(",")); valueCopy = valueCopy.substr(valueCopy.find_first_of(",") + 1); const auto KEY = valueCopy.substr(0, valueCopy.find_first_of(",")); @@ -302,6 +303,12 @@ void CConfigManager::handleBind(const std::string& command, const std::string& v return; } + if (MOD == 0 && MODSTR != "") { + Debug::log(ERR, "Invalid mod!"); + parseError = "Invalid mod, requested mod \"" + MODSTR + "\" is not a valid mod."; + return; + } + if (KEY != "") g_pKeybindManager->addKeybind(SKeybind{KEY, MOD, HANDLER, COMMAND}); }