diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-22 16:09:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-22 16:09:28 +0200 |
commit | 6aac75afc2cfe210a772228664d0d17d770547fd (patch) | |
tree | 8edd1040c9646d1f8720896bb8ff1a464b4589a5 | |
parent | f989a43135ce42a43c35193b8eecefb055aec84c (diff) | |
parent | 23a8a8c667361a3f5a596da2b090889bae83f512 (diff) |
Merge pull request #37318 from ttencate/fix/argument_nulled_37312
Revert "Allow parameters passed to GDScript functions to be nulled"
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index ca4d6f6de9..4e0891921e 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); |