From 26780b841d2b7943b093f651f3e6c72d5f138903 Mon Sep 17 00:00:00 2001 From: Matti Ruohonen Date: Tue, 17 Mar 2015 12:11:34 +0200 Subject: [PATCH] Allow pasting tags to an empty List. Converts the list's type. --- NBTModel/Data/Nodes/TagListDataNode.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NBTModel/Data/Nodes/TagListDataNode.cs b/NBTModel/Data/Nodes/TagListDataNode.cs index 0d6d4e4..0a06271 100644 --- a/NBTModel/Data/Nodes/TagListDataNode.cs +++ b/NBTModel/Data/Nodes/TagListDataNode.cs @@ -46,7 +46,7 @@ namespace NBTExplorer.Model if (data == null) return false; - if (data.Node != null && data.Node.GetTagType() == Tag.ValueType) + if (data.Node != null && (data.Node.GetTagType() == Tag.ValueType || Tag.Count == 0)) return true; } @@ -76,6 +76,10 @@ namespace NBTExplorer.Model if (clipboard == null || clipboard.Node == null) return false; + if (Tag.Count == 0) { + Tag.ChangeValueType(clipboard.Node.GetTagType()); + } + AppendTag(clipboard.Node); return true; }