From 92b0375785e1b4defa8a0a00b509f5c72264e15b Mon Sep 17 00:00:00 2001 From: kobewi Date: Sat, 29 Jun 2024 18:18:54 +0200 Subject: [PATCH] Fix some TileMapLayer editing problems --- editor/plugins/tiles/tile_map_layer_editor.cpp | 8 ++++++-- scene/2d/tile_map_layer.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/editor/plugins/tiles/tile_map_layer_editor.cpp b/editor/plugins/tiles/tile_map_layer_editor.cpp index 41b8b88f73ac..f6e4c6f95138 100644 --- a/editor/plugins/tiles/tile_map_layer_editor.cpp +++ b/editor/plugins/tiles/tile_map_layer_editor.cpp @@ -763,9 +763,13 @@ bool TileMapLayerEditorTilesPlugin::forward_canvas_gui_input(const Refupdate_viewport(); diff --git a/scene/2d/tile_map_layer.cpp b/scene/2d/tile_map_layer.cpp index 171ff7f03938..437790bb999c 100644 --- a/scene/2d/tile_map_layer.cpp +++ b/scene/2d/tile_map_layer.cpp @@ -1889,7 +1889,7 @@ void TileMapLayer::_update_self_texture_repeat(RS::CanvasItemTextureRepeat p_tex #ifdef TOOLS_ENABLED bool TileMapLayer::_edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const { - return get_cell_source_id(local_to_map(p_point)) != TileSet::INVALID_SOURCE; + return tile_set.is_valid() && get_cell_source_id(local_to_map(p_point)) != TileSet::INVALID_SOURCE; } #endif