diff --git a/Packages/Ink/InkLibs/InkRuntime/Story.cs b/Packages/Ink/InkLibs/InkRuntime/Story.cs index 45292b9b..c675c9b9 100644 --- a/Packages/Ink/InkLibs/InkRuntime/Story.cs +++ b/Packages/Ink/InkLibs/InkRuntime/Story.cs @@ -1816,7 +1816,15 @@ public void ChooseChoiceIndex(int choiceIdx) public bool HasFunction (string functionName) { try { - return KnotContainerWithName (functionName) != null; + Container container = KnotContainerWithName (functionName); + if(container != null) { + return container.content.Any(c => + c is Ink.Runtime.ControlCommand controlCommand && + controlCommand.commandType == ControlCommand.CommandType.PopFunction + ); + } else { + return false; + } } catch { return false; }