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

Merge pull request #39074 from vnen/gdscript-assert-message

Fix assert message when no custom message is set
This commit is contained in:
Rémi Verschelde
2020-05-27 08:23:17 +02:00
committed by GitHub

View File

@@ -1430,11 +1430,14 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
#ifdef DEBUG_ENABLED #ifdef DEBUG_ENABLED
GET_VARIANT_PTR(test, 1); GET_VARIANT_PTR(test, 1);
GET_VARIANT_PTR(message, 2);
bool result = test->booleanize(); bool result = test->booleanize();
if (!result) { 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()) { if (message_str.empty()) {
err_text = "Assertion failed."; err_text = "Assertion failed.";
} else { } else {