You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Refactor some object type checking code with cast_to
Less stringly typed logic, and less String allocations and comparisons.
This commit is contained in:
@@ -2584,7 +2584,7 @@ void VisualShaderEditor::_add_node(int p_idx, const Vector<Variant> &p_ops, Stri
|
||||
vsnode = Ref<VisualShaderNode>(vsn);
|
||||
} else {
|
||||
ERR_FAIL_COND(add_options[p_idx].script.is_null());
|
||||
String base_type = add_options[p_idx].script->get_instance_base_type();
|
||||
StringName base_type = add_options[p_idx].script->get_instance_base_type();
|
||||
VisualShaderNode *vsn = Object::cast_to<VisualShaderNode>(ClassDB::instantiate(base_type));
|
||||
ERR_FAIL_COND(!vsn);
|
||||
vsnode = Ref<VisualShaderNode>(vsn);
|
||||
|
||||
Reference in New Issue
Block a user