Skip to content

Commit

Permalink
Merge pull request #93974 from groud/fix_crash_editable_children_tile…
Browse files Browse the repository at this point in the history
…maplayer

Fix crash in the TileMapLayer editor when using editable children
  • Loading branch information
akien-mga committed Jul 7, 2024
2 parents 1cfcc04 + 8ebaf44 commit fbe6639
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions editor/plugins/tiles/tile_map_layer_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3630,9 +3630,16 @@ TileMapLayer *TileMapLayerEditor::_get_edited_layer() const {

void TileMapLayerEditor::_find_tile_map_layers_in_scene(Node *p_current, const Node *p_owner, Vector<TileMapLayer *> &r_list) const {
ERR_FAIL_COND(!p_current || !p_owner);
if (p_current != p_owner && p_current->get_owner() != p_owner) {
return;

if (p_current != p_owner) {
if (!p_current->get_owner()) {
return;
}
if (p_current->get_owner() != p_owner && !p_owner->is_editable_instance(p_current->get_owner())) {
return;
}
}

TileMapLayer *layer = Object::cast_to<TileMapLayer>(p_current);
if (layer) {
r_list.append(layer);
Expand Down

0 comments on commit fbe6639

Please sign in to comment.