diff options
author | Mariusz Chwalba <mariusz@chwalba.net> | 2018-10-06 12:30:45 +0200 |
---|---|---|
committer | Mariusz Chwalba <mariusz@chwalba.net> | 2018-10-06 13:26:22 +0200 |
commit | 99d9af4fbaeb9b7937f0a4b3f8c48c82207f64a5 (patch) | |
tree | 3845799b47221cd4ec656b888a1d804b0457a61a /modules/gdscript | |
parent | f12cb82e0f7b3348ab678322cf5e729b38861f1e (diff) |
Revert cause of #22794
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_function.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index 8088dcf17d..ca81d6d926 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -673,7 +673,6 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a OPCODE(OPCODE_SET_MEMBER) { CHECK_SPACE(3); -#ifdef DEBUG_ENABLED int indexname = _code_ptr[ip + 1]; GD_ERR_BREAK(indexname < 0 || indexname >= _global_names_count); const StringName *index = &_global_names_ptr[indexname]; @@ -681,6 +680,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a bool valid; bool ok = ClassDB::set_property(p_instance->owner, *index, *src, &valid); +#ifdef DEBUG_ENABLED if (!ok) { err_text = "Internal error setting property: " + String(*index); OPCODE_BREAK; @@ -696,13 +696,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a OPCODE(OPCODE_GET_MEMBER) { CHECK_SPACE(3); -#ifdef DEBUG_ENABLED int indexname = _code_ptr[ip + 1]; GD_ERR_BREAK(indexname < 0 || indexname >= _global_names_count); const StringName *index = &_global_names_ptr[indexname]; GET_VARIANT_PTR(dst, 2); - bool ok = ClassDB::get_property(p_instance->owner, *index, *dst); + +#ifdef DEBUG_ENABLED if (!ok) { err_text = "Internal error getting property: " + String(*index); OPCODE_BREAK; @@ -749,13 +749,13 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a OPCODE(OPCODE_ASSIGN_TYPED_BUILTIN) { CHECK_SPACE(4); + Variant::Type var_type = (Variant::Type)_code_ptr[ip + 1]; GET_VARIANT_PTR(dst, 2); GET_VARIANT_PTR(src, 3); -#ifdef DEBUG_ENABLED - Variant::Type var_type = (Variant::Type)_code_ptr[ip + 1]; GD_ERR_BREAK(var_type < 0 || var_type >= Variant::VARIANT_MAX); +#ifdef DEBUG_ENABLED if (src->get_type() != var_type) { if (Variant::can_convert_strict(src->get_type(), var_type)) { Variant::CallError ce; |