From f2688a8f9f46aa58586dc2459c413fb4b0fcc300 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Fri, 6 Mar 2015 00:51:58 -1000 Subject: [PATCH] When sorting the children of a TAG_LIST, preserve the original order. Order matters for TAG_LISTs. --- NBTExplorer/Controllers/NodeTreeController.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NBTExplorer/Controllers/NodeTreeController.cs b/NBTExplorer/Controllers/NodeTreeController.cs index a7a599d..be4f7ff 100644 --- a/NBTExplorer/Controllers/NodeTreeController.cs +++ b/NBTExplorer/Controllers/NodeTreeController.cs @@ -79,6 +79,16 @@ namespace NBTExplorer.Controllers } } + TagDataNode px = dx.Parent as TagDataNode; + TagDataNode py = dy.Parent as TagDataNode; + if (px != null && py != null) + { + if (px.Tag.GetTagType() == TagType.TAG_LIST || py.Tag.GetTagType() == TagType.TAG_LIST) + { + return 0; + } + } + TagType idx = dx.Tag.GetTagType(); TagType idy = dy.Tag.GetTagType(); int tagOrder = this.OrderForTag(idx).CompareTo(this.OrderForTag(idy));