mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +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
|
@ -1001,7 +1001,7 @@ void GridMapEditor::update_palette() {
|
|||
}
|
||||
|
||||
mesh_library_palette->add_item("");
|
||||
if (!preview.is_null()) {
|
||||
if (preview.is_valid()) {
|
||||
mesh_library_palette->set_item_icon(item, preview);
|
||||
mesh_library_palette->set_item_tooltip(item, name);
|
||||
}
|
||||
|
@ -1267,7 +1267,7 @@ void GridMapEditor::_update_cursor_instance() {
|
|||
if (mode_buttons_group->get_pressed_button() == paint_mode_button) {
|
||||
if (selected_palette >= 0 && node && node->get_mesh_library().is_valid()) {
|
||||
Ref<Mesh> mesh = node->get_mesh_library()->get_item_mesh(selected_palette);
|
||||
if (!mesh.is_null() && mesh->get_rid().is_valid()) {
|
||||
if (mesh.is_valid() && mesh->get_rid().is_valid()) {
|
||||
cursor_instance = RenderingServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world_3d()->get_scenario());
|
||||
RS::ShadowCastingSetting cast_shadows = (RS::ShadowCastingSetting)node->get_mesh_library()->get_item_mesh_cast_shadow(selected_palette);
|
||||
RS::get_singleton()->instance_geometry_set_cast_shadows_setting(cursor_instance, cast_shadows);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue