summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_function.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript_function.cpp')
-rw-r--r--modules/gdscript/gdscript_function.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp
index fc0c4b3138..1aab71d161 100644
--- a/modules/gdscript/gdscript_function.cpp
+++ b/modules/gdscript/gdscript_function.cpp
@@ -363,6 +363,8 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
}
}
+ static_ref = script;
+
String err_text;
#ifdef DEBUG_ENABLED
@@ -1430,11 +1432,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED
GET_VARIANT_PTR(test, 1);
- GET_VARIANT_PTR(message, 2);
bool result = test->booleanize();
if (!result) {
- const String &message_str = *message;
+ String message_str;
+ if (_code_ptr[ip + 2] != 0) {
+ GET_VARIANT_PTR(message, 2);
+ message_str = *message;
+ }
if (message_str.empty()) {
err_text = "Assertion failed.";
} else {