ink
ink copied to clipboard
Can not get tags for knot that accept parameters
I believe it is a bug because I am unable to obtain tags for a specific knot when it accepts parameters. When it does not take any parameters - everything works fine.
I've managed to do a quick workaround in Story.cs
around line 2391
Original:
List<string> tags = null;
foreach (var c in flowContainer.content) {
var tag = c as Runtime.Tag;
if (tag) {
if (tags == null) tags = new List<string> ();
tags.Add (tag.text);
} else break;
}
return tags;
Modified:
List<string> tags = null;
foreach (var c in flowContainer.content.Where(item => item is Runtime.Tag)) {
var tag = c as Runtime.Tag;
if (tag) {
if (tags == null) tags = new List<string> ();
tags.Add (tag.text);
} else break;
}
return tags;
It is caused how content is organized. When there are parameters in the knot the first object in flowContainer.content is of type VariableAssignment and thus the flow breaks and null list is being returned.
any updates?
Wow, that would be a total showstopper for my game. Your fix seemed to fix it? Then it should probably be added sooner rather than later. Good catch!
We've not looked at this yet. Submitting a pull request might help us to keep track of it though, if you have the time to do that?
We've not looked at this yet. Submitting a pull request might help us to keep track of it though, if you have the time to do that?
@joningold I've just created the pull request with necessary fix. https://github.com/inkle/ink/pull/640