1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

[3.x] Prevents some warnings from appearing in visual scripts

This commit is contained in:
Yuri Roubinsky
2021-08-03 11:27:45 +03:00
parent 38d47c051a
commit 96f957f93b
2 changed files with 19 additions and 2 deletions

View File

@@ -188,7 +188,10 @@ PropertyInfo VisualScriptFunction::get_input_value_port_info(int p_idx) const {
ERR_FAIL_V(PropertyInfo());
}
PropertyInfo VisualScriptFunction::get_output_value_port_info(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, arguments.size(), PropertyInfo());
// Need to check it without ERR_FAIL_COND, to prevent warnings from appearing on node creation via dragging.
if (p_idx < 0 || p_idx >= arguments.size()) {
return PropertyInfo();
}
PropertyInfo out;
out.type = arguments[p_idx].type;
out.name = arguments[p_idx].name;