Merge pull request #29 from maruohon/paste-into-empty-list

Allow pasting tags to an empty List. Converts the list's type.
This commit is contained in:
Justin Aquadro 2015-03-18 01:48:55 -04:00
commit a9f40fc596

View file

@ -46,7 +46,7 @@ namespace NBTExplorer.Model
if (data == null) if (data == null)
return false; 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; return true;
} }
@ -76,6 +76,10 @@ namespace NBTExplorer.Model
if (clipboard == null || clipboard.Node == null) if (clipboard == null || clipboard.Node == null)
return false; return false;
if (Tag.Count == 0) {
Tag.ChangeValueType(clipboard.Node.GetTagType());
}
AppendTag(clipboard.Node); AppendTag(clipboard.Node);
return true; return true;
} }