Merge pull request #115633 from AThousandShips/fix_invalid_event

[Input] Handle invalid `input/` settings correctly
This commit is contained in:
Thaddeus Crews
2026-02-04 11:04:18 -06:00
2 changed files with 10 additions and 0 deletions

View File

@@ -317,6 +317,11 @@ void InputMap::load_from_project_settings() {
String name = pi.name.substr(pi.name.find_char('/') + 1);
Dictionary action = GLOBAL_GET(pi.name);
if (!action.has("events")) {
continue;
}
float deadzone = action.has("deadzone") ? (float)action["deadzone"] : DEFAULT_DEADZONE;
Array events = action["events"];

View File

@@ -613,6 +613,11 @@ void ProjectSettingsEditor::_update_action_map_editor() {
String display_name = property_name.substr(String("input/").size() - 1);
Dictionary action = GLOBAL_GET(property_name);
if (!action.has("events")) {
WARN_PRINT_ONCE_ED(vformat("Attempted to load invalid input action from setting at \"%s\". The `input/` prefix should only be used for input actions, and cannot be changed in the settings editor. Consider changing the category.", property_name));
continue;
}
ActionMapEditor::ActionInfo action_info;
action_info.action = action;
action_info.editable = true;