aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_function.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-09-19 19:03:25 +0200
committerGitHub2017-09-19 19:03:25 +0200
commitd58b0a5c9a3ca7964ea560b72fc321b4159df89d (patch)
treeb61ff45291c99b23e9c6bcb4ba890d2d4a5536a7 /modules/gdscript/gd_function.cpp
parent67aa409f596515894fa855492a31976a3044381c (diff)
parent833c3917b247baa46f5a5f6ad6ce478cffc1911d (diff)
downloadgodot-d58b0a5c9a3ca7964ea560b72fc321b4159df89d.tar.gz
godot-d58b0a5c9a3ca7964ea560b72fc321b4159df89d.tar.zst
godot-d58b0a5c9a3ca7964ea560b72fc321b4159df89d.zip
Diffstat (limited to 'modules/gdscript/gd_function.cpp')
-rw-r--r--modules/gdscript/gd_function.cpp27
1 files changed, 3 insertions, 24 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 438d484a4..df7b16c96 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -982,15 +982,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
GET_VARIANT_PTR(test, 1);
- bool valid;
- bool result = test->booleanize(valid);
-#ifdef DEBUG_ENABLED
- if (!valid) {
+ bool result = test->booleanize();
- err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type());
- break;
- }
-#endif
if (result) {
int to = _code_ptr[ip + 2];
GD_ERR_BREAK(to < 0 || to > _code_size);
@@ -1006,15 +999,8 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
GET_VARIANT_PTR(test, 1);
- bool valid;
- bool result = test->booleanize(valid);
-#ifdef DEBUG_ENABLED
- if (!valid) {
+ bool result = test->booleanize();
- err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type());
- break;
- }
-#endif
if (!result) {
int to = _code_ptr[ip + 2];
GD_ERR_BREAK(to < 0 || to > _code_size);
@@ -1107,14 +1093,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
GET_VARIANT_PTR(test, 1);
#ifdef DEBUG_ENABLED
- bool valid;
- bool result = test->booleanize(valid);
-
- if (!valid) {
-
- err_text = "cannot evaluate conditional expression of type: " + Variant::get_type_name(test->get_type());
- break;
- }
+ bool result = test->booleanize();
if (!result) {