瀏覽代碼

Fix for reselecting a TileMap node without first de-selecting it

andrew-softdev 4 年之前
父節點
當前提交
15cffe060c
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      editor/plugins/tile_map_editor_plugin.cpp

+ 4 - 1
editor/plugins/tile_map_editor_plugin.cpp

@@ -39,7 +39,10 @@
 #include "scene/gui/split_container.h"
 
 void TileMapEditor::_node_removed(Node *p_node) {
-	if (p_node == node) {
+	if (p_node == node && node) {
+		// Fixes #44824, which describes a situation where you can reselect a TileMap node without first de-selecting it when switching scenes.
+		node->disconnect("settings_changed", callable_mp(this, &TileMapEditor::_tileset_settings_changed));
+
 		node = nullptr;
 	}
 }