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

Add type validations when setting basic type

This commit is contained in:
LATRio
2021-10-06 18:16:06 +09:00
parent 67db681871
commit 47f0cf7460
3 changed files with 8 additions and 0 deletions

View File

@@ -282,6 +282,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;
}
@@ -1068,6 +1069,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;
}
@@ -1916,6 +1918,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;
}