Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add type validations when setting basic type #53465

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/visual_script/visual_script_func_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ String VisualScriptFunctionCall::get_text() const {
}

void VisualScriptFunctionCall::set_basic_type(Variant::Type p_type) {
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
if (basic_type == p_type) {
return;
}
Expand Down Expand Up @@ -1074,6 +1075,7 @@ void VisualScriptPropertySet::_update_base_type() {
}

void VisualScriptPropertySet::set_basic_type(Variant::Type p_type) {
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
if (basic_type == p_type) {
return;
}
Expand Down Expand Up @@ -1937,6 +1939,7 @@ VisualScriptPropertyGet::CallMode VisualScriptPropertyGet::get_call_mode() const
}

void VisualScriptPropertyGet::set_basic_type(Variant::Type p_type) {
ERR_FAIL_INDEX(p_type, Variant::VARIANT_MAX);
if (basic_type == p_type) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions modules/visual_script/visual_script_nodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,7 @@ StringName VisualScriptBasicTypeConstant::get_basic_type_constant() const {
}

void VisualScriptBasicTypeConstant::set_basic_type(Variant::Type p_which) {
ERR_FAIL_INDEX(p_which, Variant::VARIANT_MAX);
type = p_which;

List<StringName> constants;
Expand Down