mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 22:21:18 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
parent
0f95e9f8e6
commit
a1846b27ea
177 changed files with 517 additions and 519 deletions
|
|
@ -149,7 +149,7 @@ void AnimationNodeBlendTreeEditor::update_graph() {
|
|||
node->set_draggable(!read_only);
|
||||
|
||||
Ref<AnimationNode> agnode = blend_tree->get_node(E);
|
||||
ERR_CONTINUE(!agnode.is_valid());
|
||||
ERR_CONTINUE(agnode.is_null());
|
||||
|
||||
node->set_position_offset(blend_tree->get_node_position(E) * EDSCALE);
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ void AnimationNodeBlendTreeEditor::_add_node(int p_idx) {
|
|||
base_name = anode->get_class();
|
||||
} else if (p_idx == MENU_PASTE) {
|
||||
anode = EditorSettings::get_singleton()->get_resource_clipboard();
|
||||
ERR_FAIL_COND(!anode.is_valid());
|
||||
ERR_FAIL_COND(anode.is_null());
|
||||
base_name = anode->get_class();
|
||||
} else if (!add_options[p_idx].type.is_empty()) {
|
||||
AnimationNode *an = Object::cast_to<AnimationNode>(ClassDB::instantiate(add_options[p_idx].type));
|
||||
|
|
@ -498,7 +498,7 @@ void AnimationNodeBlendTreeEditor::_anim_selected(int p_index, const Array &p_op
|
|||
String option = p_options[p_index];
|
||||
|
||||
Ref<AnimationNodeAnimation> anim = blend_tree->get_node(p_node);
|
||||
ERR_FAIL_COND(!anim.is_valid());
|
||||
ERR_FAIL_COND(anim.is_null());
|
||||
|
||||
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
|
||||
undo_redo->create_action(TTR("Set Animation"));
|
||||
|
|
@ -584,14 +584,14 @@ void AnimationNodeBlendTreeEditor::_node_selected(Object *p_node) {
|
|||
String name = gn->get_name();
|
||||
|
||||
Ref<AnimationNode> anode = blend_tree->get_node(name);
|
||||
ERR_FAIL_COND(!anode.is_valid());
|
||||
ERR_FAIL_COND(anode.is_null());
|
||||
|
||||
EditorNode::get_singleton()->push_item(anode.ptr(), "", true);
|
||||
}
|
||||
|
||||
void AnimationNodeBlendTreeEditor::_open_in_editor(const String &p_which) {
|
||||
Ref<AnimationNode> an = blend_tree->get_node(p_which);
|
||||
ERR_FAIL_COND(!an.is_valid());
|
||||
ERR_FAIL_COND(an.is_null());
|
||||
AnimationTreeEditor::get_singleton()->enter_editor(p_which);
|
||||
}
|
||||
|
||||
|
|
@ -918,7 +918,7 @@ void AnimationNodeBlendTreeEditor::_inspect_filters(const String &p_which) {
|
|||
filter_enabled->set_disabled(read_only);
|
||||
|
||||
Ref<AnimationNode> anode = blend_tree->get_node(p_which);
|
||||
ERR_FAIL_COND(!anode.is_valid());
|
||||
ERR_FAIL_COND(anode.is_null());
|
||||
|
||||
_filter_edit = anode;
|
||||
if (!_update_filters(anode)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue