summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorThomas ten Cate <ttencate@gmail.com>2020-03-26 17:02:28 +0100
committerThomas ten Cate <ttencate@gmail.com>2020-03-26 17:02:28 +0100
commit23a8a8c667361a3f5a596da2b090889bae83f512 (patch)
treeda967e56708d0dcf020bb09e840a4287841b507d /modules/gdscript
parenta2da99f40cf2123c0906c734a2eb01e9b65a45a2 (diff)
Revert "Allow parameters passed to GDScript functions to be nulled"
This reverts commit f0efc7521e7302e60ebaab31a42fafd3ea2bda68. Fixes #37312.
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_function.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index 0721c25388..c18094ec69 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -337,15 +337,10 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
}
if (!argument_types[i].is_type(*p_args[i], true)) {
- if (argument_types[i].is_type(Variant(), true)) {
- memnew_placement(&stack[i], Variant);
- continue;
- } else {
- r_err.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
- r_err.argument = i;
- r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT;
- return Variant();
- }
+ r_err.error = Callable::CallError::CALL_ERROR_INVALID_ARGUMENT;
+ r_err.argument = i;
+ r_err.expected = argument_types[i].kind == GDScriptDataType::BUILTIN ? argument_types[i].builtin_type : Variant::OBJECT;
+ return Variant();
}
if (argument_types[i].kind == GDScriptDataType::BUILTIN) {
Variant arg = Variant::construct(argument_types[i].builtin_type, &p_args[i], 1, r_err);