diff --git a/core/object.cpp b/core/object.cpp index c535d391aa9f..58579f2be975 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1561,20 +1561,14 @@ void Object::_set_bind(const String &p_set, const Variant &p_value) { bool valid = false; set(p_set, p_value, &valid); - if (!valid) { - ERR_EXPLAIN("Cannot set property \"" + p_set + "\" in an instance of " + get_class_name()); - ERR_FAIL(); - } + ERR_FAIL_COND_MSG(!valid, "Cannot set property \"" + p_set + "\" in an instance of " + get_class_name()) } Variant Object::_get_bind(const String &p_name) const { bool valid = false; Variant result = get(p_name, &valid); - if (!valid) { - ERR_EXPLAIN("Cannot get property \"" + p_name + "\" in an instance of " + get_class_name()); - ERR_FAIL_V(Variant()); - } + ERR_FAIL_COND_V_MSG(!valid, Variant(), "Cannot get property \"" + p_name + "\" in an instance of " + get_class_name()) return result; } diff --git a/modules/gdscript/gdscript_function.h b/modules/gdscript/gdscript_function.h index 6bdfb8638c26..086122901912 100644 --- a/modules/gdscript/gdscript_function.h +++ b/modules/gdscript/gdscript_function.h @@ -79,10 +79,7 @@ struct GDScriptDataType { Object *obj = p_variant.operator Object *(); if (obj) { - if (!ObjectDB::instance_validate(obj)) { - ERR_EXPLAIN("Invalid object instance (already freed?)"); - ERR_FAIL_V(false); - } + ERR_FAIL_COND_V_MSG(!ObjectDB::instance_validate(obj), false, "Invalid object instance (already freed?)"); if (!ClassDB::is_parent_class(obj->get_class_name(), native_type)) { // Try with underscore prefix StringName underscore_native_type = "_" + native_type; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 5170bbee6e44..3a2a1f0969b1 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -199,10 +199,6 @@ Size2 Control::get_combined_minimum_size() const { return data.minimum_size_cache; } -Size2 Control::_edit_get_minimum_size() const { - - return get_combined_minimum_size(); -} #ifdef DEBUG_ENABLED @@ -224,8 +220,7 @@ void Control::_draw_debug_area() { break; } default: { - ERR_EXPLAIN("Invalid mouse filter"); - ERR_FAIL(); + ERR_FAIL_MSG("Invalid mouse filter"); } }