浏览代码

Merge pull request #66894 from KoBeWi/TileSetAtlasSourceEditor_on_vacation

Disconnect TileSet from source editor if no sources
Rémi Verschelde 2 年之前
父节点
当前提交
b904789242
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      editor/plugins/tiles/tile_set_atlas_source_editor.cpp

+ 7 - 0
editor/plugins/tiles/tile_set_atlas_source_editor.cpp

@@ -2043,6 +2043,13 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw() {
 }
 
 void TileSetAtlasSourceEditor::_tile_set_changed() {
+	if (tile_set->get_source_count() == 0) {
+		// No sources, so nothing to do here anymore.
+		tile_set->disconnect("changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_set_changed));
+		tile_set = Ref<TileSet>();
+		return;
+	}
+
 	tile_set_changed_needs_update = true;
 }