From b23db3b1f6b0a401d72481ff5a41ce9ba6bf3fda Mon Sep 17 00:00:00 2001 From: Joseph Humfrey Date: Sun, 16 Oct 2016 09:42:57 +0100 Subject: [PATCH] Fix for tags extraction being broken, after container inlining was implemented --- ink-engine-runtime/Story.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ink-engine-runtime/Story.cs b/ink-engine-runtime/Story.cs index ab394d77..0c1fd8a8 100644 --- a/ink-engine-runtime/Story.cs +++ b/ink-engine-runtime/Story.cs @@ -1585,13 +1585,16 @@ List TagsAtStartOfFlowContainerWithPathString (string pathString) // Expected to be global story, knot or stitch var flowContainer = ContentAtPath (path) as Container; - - // First element of the above constructs is a compiled weave - var innerWeaveContainer = flowContainer.content [0] as Container; + while(true) { + var firstContent = flowContainer.content [0]; + if (firstContent is Container) + flowContainer = (Container)firstContent; + else break; + } // Any initial tag objects count as the "main tags" associated with that story/knot/stitch List tags = null; - foreach (var c in innerWeaveContainer.content) { + foreach (var c in flowContainer.content) { var tag = c as Runtime.Tag; if (tag) { if (tags == null) tags = new List ();